Panel Interface Board  1
inszt_adc.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:17:31 2020
5 */
6 /**************************************************************************************/
23 /**************************************************************************************/
24 /**************************************************************************************/
25 /**************************************************************************************/
26 /* Section: Included Files */
27 /**************************************************************************************/
28 /**************************************************************************************/
29 #define QQQdialect MPLABX
30 #undef QQQ146
31 #undef QQQ148
32 #undef QQQbndchk
33 #undef QQQ294
34 #undef QQQEMBEDDEDICE
35  /* Note: for BITMAP execution histories QQQthreaded is not defined */
36 #undef QQQthreaded
37 #undef QQQdo178b
38 #undef QQQfixbra
39 #define QQQswitch3
40 #undef QQQternary
41 #define QQQswitch
42 #undef QQQmacrof
43 #undef QQQMULTIPROCESSEXH
44 #undef QQFLUSH
45 #undef QQNEWBS
46 #define qqqMaxBranchDepth 20
47 #define QQQstructbitmap
48  static int qqqqbmselwidth = 32 ;
49  static int zzfileid = 63;
50 #define QQQnumfil 23
51 #undef QQQALGONE
52 #undef QQQVCLFLG
53 #undef QQQFORKFL
54 #undef QQQIADDRF
55 #undef QQQRTI
56 #undef QQQPERFA
57 #undef QQQADRMOD
58 #undef QQQDCAPFL
59 #undef QQQTEMPLATEONLY
60 #define QQQNOATEXIT
61 #define QQQUPLOADATEND
62 #define QQQNOSTDIO
63 #undef QQQASHLINGVITRA
64 #define QQQBITMAP
65  #define qqqbitmapint unsigned int
66 #undef QQQBITMAPMCDC
67 #undef QQQTIC2XSERIALIO
68 #undef QQQTIC2XFLASH
69 #undef QQQCOMPRESSED_EXH
70 #undef QQQMAINFL
71 #define QQQSINGLEFILE
72 #define QQQFILEID
73 #define QQQseparate
74 extern int QQQindicator;
75 static int QQQfirstmcdc=1;
76 #define adc_63zzopen zzopen
77  extern int adc_63zzopen ;
78 #define adc_63zqqzqz1 zqqzqz1
79 #define QQQLDRA_PORT
80 #ifndef QQQLDRA_PORT
81 #define FILEPOINT FILE * f,
82 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
83 #include <stdio.h>
84  /* ----------------------------------------------------------------------* 100 *
85  * If stdio.h is not available then insert:
86  * typedef int * FILE;
87  * -----------------------------------------------------------------------------
88  */
89 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
90 #else /* QQQLDRA_PORT */
91 #define FILEPOINT
92 /*************************** LDRA_PORT *********************************/
93 #ifdef QQQ_SHLAYOUT
94 static int tbrun_mode=1;
95 #else
96 static int tbrun_mode=0;
97 #endif /* QQQ_SHLAYOUT */
98 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
99 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
100 #ifndef QQQ_SHLAYOUT
101 #ifdef QQQMAINFL
102 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
103 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
104 #endif /* QQQMAINFL */
105 #endif /* QQQ_SHLAYOUT */
106 /************************ END OF LDRA_PORT *****************************/
107 #endif /* QQQLDRA_PORT */
108 #ifndef QQQnumfil
109 #define QQQnumfil 40 /* default setting */
110 #endif /* QQQnumfil */
111 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
112 #ifndef LDRA_VOID_FUNC
113 #define LDRA_VOID_FUNC
114  typedef void(*ldra_void_function)();
115 #endif
116 #if defined(QQQMAINFL)
117  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
118  through the target you would have to set this to 0 before calling the qqqupload.
119  Move this into ldra_port mechanism. */
120  int qqqshell_upload = 0;
121  int QQQfcn_ptr_num = 0;
122  static int qqqisinitialised = 0;
125  void qqqtotalupload(void);
126  void qqqtotalreset(void);
128  qqqaccumupload[x]=y;
129  qqqaccumreset[x]=z;
130  QQQfcn_ptr_num++;
131  }
132 #else /* (QQQMAINFL) */
133  extern int QQQfcn_ptr_num;
136  static int qqqstructzzopen = 0;
137 #endif /* defined(QQQMAINFL) */
138 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
139 #ifdef QQQ_KEEPCOMMENTS
140  /* -----------------------------------------------------------------------* 101 *
141  * Special settings for systems lacking standard functions.
142  * To include code for fprintf define ldra_fprintf
143  * To include code for sscanf define ldra_sscanf
144  * -----------------------------------------------------------------------------
145  */
146 #endif /* QQQ_KEEPCOMMENTS */
147 #if !defined(QQQSUPPRESS_UNDEF)
148 #undef ldra_fprintf
149 #undef ldra_sscanf
150 #endif /* !defined(QQQSUPPRESS_UNDEF) */
151  /* #define ldra_fprintf */
152  /* #define ldra_sscanf */
153 #undef QQQHITMAP_STORAGE
154 #undef qqnull_params
155 #define qqnull_params void
156 #define QQQ_PROTOTYPE_DEF
157  /* Conventional Instrumentation */
158 #undef QQ_ANSI_PROTOTYPE
159 #ifdef __STDC__
160 #define QQ_ANSI_PROTOTYPE 1
161 #else /* __STDC__ */
162 #ifdef VAXC
163 #define QQ_ANSI_PROTOTYPE 1
164 #endif /* VAXC */
165 #endif /* __STDC__ */
166  static unsigned char qqqzzglobflag = 0;
167  static struct bitmapstruct_t
168  {
169 #define ELEMENT(N) qqqbitmapint element##N;
170 #define LASTELEMENT
171 #include "adc_63zbelem.def"
172 #undef ELEMENT
173 #undef LASTELEMENT
174  } bitmapstruct = {
175 #define ELEMENT(N) 0,
176 #undef LASTELEMENT
177 #include "adc_63zbelem.def"
178 #undef ELEMENT
179  0};
180  static void qqoutput(FILEPOINT char * s,int i);
181  static void qqoutput2(FILEPOINT char * s,int i, int j);
182  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
183  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
184  static void qqoutput0(FILEPOINT char * s);
185  static int adc_63zqqzqz(qqnull_params);
186  static int adc_63zqqzqz1(qqnull_params);
187  static int adc_63zqendz (int qqqi);
188  static int adc_63zqzqzq (int qqqi);
189  static void qqqupload(qqnull_params);
190  static void qqqbitmapreset(qqnull_params);
191 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
192 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h */
193 /**************************************************************************************/
207 /**************************************************************************************/
208 #ifndef ADC_H /* Guard against multiple inclusion.*/
209 #define ADC_H
210 /**************************************************************************************/
211 /**************************************************************************************/
212 /* Section: Included Files */
213 /**************************************************************************************/
214 /**************************************************************************************/
215 #include <stdint.h>
216 #include <stdbool.h>
217 /**************************************************************************************/
218 /**************************************************************************************/
219 /* Section: Data Types */
220 /**************************************************************************************/
221 /**************************************************************************************/
222 /**************************************************************************************/
223 /* ADC states
224  Summary:
225  ADC states enumeration
226  Description:
227  This enumeration defines the valid ADC states. These states
228  determine the behavior of the ADC state machine at various times.
229 */
230 
231 typedef
232  enum
233  {
238  } ADC_STATES ;
239 /**************************************************************************************/
240 /* ADC_DATA
241  Summary:
242  Holds ADC_DATA used for the ADC tasks.
243  Description:
244  Holds ADC_DATA used for the ADC tasks. The state machine and variables
245  used to control ADC functions are stored here.
246  Remarks:
247  None
248  */
249 
250 typedef
251  struct /* This structure collects the variables and states required for these*/
252  {
253  /* functions to operate.*/
254  ADC_STATES state ;
255  uint16_t hvps_i ;
256  uint16_t hvps_cont ;
257  uint16_t wl_cps_i ;
258  uint16_t wl_cps_v ;
259  uint16_t wl_sps_i_cf ;
260  uint16_t wl_sps_i ;
261  bool tick ;
262  bool ADCInt ;
263  } ADC_DATA ;
264 
265 extern ADC_DATA
266  ADC ;
267 /**************************************************************************************/
268 /**************************************************************************************/
269 /* State Machine Functions */
270 /**************************************************************************************/
271 /**************************************************************************************/
272 /*!*************************************************************************************
273  Function:
274  void ADC_Tasks(void)
275  Summary:
276  ADC tasks function
277  Description:
278  This routine is the ADC tasks function. It defines the ADC's state machine and
279  core logic. This machine initializes the Timer and ADCs used to digitize signal
280  inputs. Once the timer and ADCs are started, this machine is set to idle and the
281  the updated ADC values are retrieved in the system interrupt routine.
282  Precondition:
283  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
284  should be called before calling this.
285  Parameters:
286  None.
287  Returns:
288  None.
289  Example:
290  ADC_Tasks()
291 
292  Remarks:
293  This routine must be called from the APP_Tasks() routine.
294  */
295 
296 void
297  ADC_Tasks ( void ) ;
298  /* ADC_H */
299 /***************************************************************************************
300  End of File
301  */
302 
303 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h*/
304 /* CLOSE_FILE Include File */
305 
306 #include <stdbool.h>
307 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
308 /*******************************************************************************
309  System Definitions
310  File Name:
311  system_definitions.h
312  Summary:
313  MPLAB Harmony project system definitions.
314  Description:
315  This file contains the system-wide prototypes and definitions for an MPLAB
316  Harmony project.
317  *******************************************************************************/
318 //DOM-IGNORE-BEGIN
319 /*******************************************************************************
320 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
321 Microchip licenses to you the right to use, modify, copy and distribute
322 Software only when embedded on a Microchip microcontroller or digital signal
323 controller that is integrated into your product or third party product
324 (pursuant to the sublicense terms in the accompanying license agreement).
325 You should refer to the license agreement accompanying this Software for
326 additional information regarding your rights and obligations.
327 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
328 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
329 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
330 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
331 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
332 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
333 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
334 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
335 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
336 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
337  *******************************************************************************/
338 //DOM-IGNORE-END
339 #ifndef _SYS_DEFINITIONS_H
340 #define _SYS_DEFINITIONS_H
341 // *****************************************************************************
342 // *****************************************************************************
343 // Section: Included Files
344 // *****************************************************************************
345 // *****************************************************************************
346 #include <stdint.h>
347 #include <stddef.h>
348 #include <stdbool.h>
349 #include "system/common/sys_common.h"
350 #include "system/common/sys_module.h"
351 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
352 /*******************************************************************************
353  Input Capture Driver Interface Declarations for Static Single Instance Driver
354  Company:
355  Microchip Technology Inc.
356  File Name:
357  help_drv_ic.h
358  Summary:
359  Input Capture driver interface declarations for the static single instance
360  driver.
361  Description:
362  The Input Capture device driver provides a simple interface to manage the
363  Input Capture modules on Microchip microcontrollers. This file defines
364  the interface declarations for the IC driver.
365 
366  Remarks:
367  Static interfaces incorporate the driver instance number within the names
368  of the routines, eliminating the need for an object ID or object handle.
369 
370  Static single-open interfaces also eliminate the need for the open handle.
371 *******************************************************************************/
372 //DOM-IGNORE-BEGIN
373 /*******************************************************************************
374 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
375 Microchip licenses to you the right to use, modify, copy and distribute
376 Software only when embedded on a Microchip microcontroller or digital signal
377 controller that is integrated into your product or third party product
378 (pursuant to the sublicense terms in the accompanying license agreement).
379 You should refer to the license agreement accompanying this Software for
380 additional information regarding your rights and obligations.
381 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
382 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
383 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
384 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
385 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
386 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
387 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
388 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
389 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
390 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
391 *******************************************************************************/
392 //DOM-IGNORE-END
393 #ifndef _DRV_IC_H
394 #define _DRV_IC_H
395 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
396 /*******************************************************************************
397  MPLAB Harmony System Configuration Header
398  File Name:
399  system_config.h
400  Summary:
401  Build-time configuration header for the system defined by this MPLAB Harmony
402  project.
403  Description:
404  An MPLAB Project may have multiple configurations. This file defines the
405  build-time options for a single configuration.
406  Remarks:
407  This configuration header must not define any prototypes or data
408  definitions (or include any files that do). It only provides macro
409  definitions for build-time configuration options that are not instantiated
410  until used by another MPLAB Harmony module or application.
411  Created with MPLAB Harmony Version 2.06
412 *******************************************************************************/
413 // DOM-IGNORE-BEGIN
414 /*******************************************************************************
415 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
416 Microchip licenses to you the right to use, modify, copy and distribute
417 Software only when embedded on a Microchip microcontroller or digital signal
418 controller that is integrated into your product or third party product
419 (pursuant to the sublicense terms in the accompanying license agreement).
420 You should refer to the license agreement accompanying this Software for
421 additional information regarding your rights and obligations.
422 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
423 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
424 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
425 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
426 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
427 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
428 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
429 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
430 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
431 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
432 *******************************************************************************/
433 // DOM-IGNORE-END
434 #ifndef _SYSTEM_CONFIG_H
435 #define _SYSTEM_CONFIG_H
436 // *****************************************************************************
437 // *****************************************************************************
438 // Section: Included Files
439 // *****************************************************************************
440 // *****************************************************************************
441 /* This section Includes other configuration headers necessary to completely
442  define this configuration.
443 */
444 // DOM-IGNORE-BEGIN
445 // DOM-IGNORE-END
446 // *****************************************************************************
447 // *****************************************************************************
448 // Section: System Service Configuration
449 // *****************************************************************************
450 // *****************************************************************************
451 // *****************************************************************************
452 /* Common System Service Configuration Options
453 */
454 #define SYS_VERSION_STR "2.06"
455 #define SYS_VERSION 20600
456 // *****************************************************************************
457 /* Clock System Service Configuration Options
458 */
459 #define SYS_CLK_FREQ 200000000ul
460 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
461 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
462 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
463 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
464 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
465 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
466 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
467 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
468 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
469 /*** Ports System Service Configuration ***/
470 #define SYS_PORT_A_ANSEL 0x3F00
471 #define SYS_PORT_A_TRIS 0xFFED
472 #define SYS_PORT_A_LAT 0x0010
473 #define SYS_PORT_A_ODC 0x0000
474 #define SYS_PORT_A_CNPU 0x0020
475 #define SYS_PORT_A_CNPD 0x0000
476 #define SYS_PORT_A_CNEN 0x0021
477 #define SYS_PORT_B_ANSEL 0x10C8
478 #define SYS_PORT_B_TRIS 0x91FF
479 #define SYS_PORT_B_LAT 0x0000
480 #define SYS_PORT_B_ODC 0x0000
481 #define SYS_PORT_B_CNPU 0x0000
482 #define SYS_PORT_B_CNPD 0x0000
483 #define SYS_PORT_B_CNEN 0x0000
484 #define SYS_PORT_C_ANSEL 0xCFE1
485 #define SYS_PORT_C_TRIS 0xFFFF
486 #define SYS_PORT_C_LAT 0x0000
487 #define SYS_PORT_C_ODC 0x0000
488 #define SYS_PORT_C_CNPU 0x0000
489 #define SYS_PORT_C_CNPD 0x0000
490 #define SYS_PORT_C_CNEN 0x0000
491 #define SYS_PORT_D_ANSEL 0xC100
492 #define SYS_PORT_D_TRIS 0xFFFF
493 #define SYS_PORT_D_LAT 0x0000
494 #define SYS_PORT_D_ODC 0x0000
495 #define SYS_PORT_D_CNPU 0x0000
496 #define SYS_PORT_D_CNPD 0x0000
497 #define SYS_PORT_D_CNEN 0x0000
498 #define SYS_PORT_E_ANSEL 0xFC00
499 #define SYS_PORT_E_TRIS 0xFDFF
500 #define SYS_PORT_E_LAT 0x0000
501 #define SYS_PORT_E_ODC 0x0000
502 #define SYS_PORT_E_CNPU 0x0000
503 #define SYS_PORT_E_CNPD 0x0000
504 #define SYS_PORT_E_CNEN 0x0000
505 #define SYS_PORT_F_ANSEL 0xCEC0
506 #define SYS_PORT_F_TRIS 0xEFFF
507 #define SYS_PORT_F_LAT 0x0000
508 #define SYS_PORT_F_ODC 0x0000
509 #define SYS_PORT_F_CNPU 0x0000
510 #define SYS_PORT_F_CNPD 0x0000
511 #define SYS_PORT_F_CNEN 0x0000
512 #define SYS_PORT_G_ANSEL 0x8CBC
513 #define SYS_PORT_G_TRIS 0xDFFF
514 #define SYS_PORT_G_LAT 0x0000
515 #define SYS_PORT_G_ODC 0x0000
516 #define SYS_PORT_G_CNPU 0x0000
517 #define SYS_PORT_G_CNPD 0x0000
518 #define SYS_PORT_G_CNEN 0x0000
519 #define SYS_PORT_H_ANSEL 0x0070
520 #define SYS_PORT_H_TRIS 0xB3FB
521 #define SYS_PORT_H_LAT 0x0000
522 #define SYS_PORT_H_ODC 0x0000
523 #define SYS_PORT_H_CNPU 0x0000
524 #define SYS_PORT_H_CNPD 0x0000
525 #define SYS_PORT_H_CNEN 0x0000
526 #define SYS_PORT_J_ANSEL 0x0000
527 #define SYS_PORT_J_TRIS 0x8B7F
528 #define SYS_PORT_J_LAT 0x0080
529 #define SYS_PORT_J_ODC 0x0000
530 #define SYS_PORT_J_CNPU 0x0000
531 #define SYS_PORT_J_CNPD 0x0000
532 #define SYS_PORT_J_CNEN 0x0800
533 #define SYS_PORT_K_ANSEL 0xFF00
534 #define SYS_PORT_K_TRIS 0xFFFF
535 #define SYS_PORT_K_LAT 0x0000
536 #define SYS_PORT_K_ODC 0x0000
537 #define SYS_PORT_K_CNPU 0x0000
538 #define SYS_PORT_K_CNPD 0x0000
539 #define SYS_PORT_K_CNEN 0x0000
540 /*** Interrupt System Service Configuration ***/
541 #define SYS_INT true
542 /*** Timer System Service Configuration ***/
543 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
544 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
545 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
546 #define SYS_TMR_FREQUENCY 1000
547 #define SYS_TMR_FREQUENCY_TOLERANCE 10
548 #define SYS_TMR_UNIT_RESOLUTION 10000
549 #define SYS_TMR_CLIENT_TOLERANCE 10
550 #define SYS_TMR_INTERRUPT_NOTIFICATION false
551 // *****************************************************************************
552 // *****************************************************************************
553 // Section: Driver Configuration
554 // *****************************************************************************
555 // *****************************************************************************
556 #define DRV_IC_DRIVER_MODE_STATIC
557 #define USE_8BIT_PMP
558 /*** SPI Driver Configuration ***/
559 #define DRV_SPI_NUMBER_OF_MODULES 6
560 /*** Driver Compilation and static configuration options. ***/
561 /*** Select SPI compilation units.***/
562 #define DRV_SPI_POLLED 1
563 #define DRV_SPI_ISR 0
564 #define DRV_SPI_MASTER 1
565 #define DRV_SPI_SLAVE 0
566 #define DRV_SPI_RM 0
567 #define DRV_SPI_EBM 1
568 #define DRV_SPI_8BIT 1
569 #define DRV_SPI_16BIT 1
570 #define DRV_SPI_32BIT 0
571 #define DRV_SPI_DMA 0
572 /*** SPI Driver Static Allocation Options ***/
573 #define DRV_SPI_INSTANCES_NUMBER 3
574 #define DRV_SPI_CLIENTS_NUMBER 3
575 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
576 /* SPI Driver Instance 0 Configuration */
577 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
578 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
579 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
580 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
581 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
582 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
583 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
584 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
585 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
586 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
587 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
588 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
589 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
590 #define DRV_SPI_BAUD_RATE_IDX0 1000000
591 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
592 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
593 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
594 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
595 #define DRV_SPI_QUEUE_SIZE_IDX0 10
596 #define DRV_SPI_RESERVED_JOB_IDX0 1
597 /* SPI Driver Instance 1 Configuration */
598 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
599 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
600 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
601 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
602 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
603 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
604 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
605 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
606 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
607 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
608 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
609 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
610 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
611 #define DRV_SPI_BAUD_RATE_IDX1 1000000
612 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
613 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
614 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
615 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
616 #define DRV_SPI_QUEUE_SIZE_IDX1 10
617 #define DRV_SPI_RESERVED_JOB_IDX1 1
618 /* SPI Driver Instance 2 Configuration */
619 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
620 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
621 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
622 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
623 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
624 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
625 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
626 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
627 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
628 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
629 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
630 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
631 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
632 #define DRV_SPI_BAUD_RATE_IDX2 500000
633 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
634 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
635 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
636 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
637 #define DRV_SPI_QUEUE_SIZE_IDX2 10
638 #define DRV_SPI_RESERVED_JOB_IDX2 1
639 /*** Timer Driver Configuration ***/
640 #define DRV_TMR_INTERRUPT_MODE true
641 /*** Timer Driver 0 Configuration ***/
642 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
643 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
644 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
645 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
646 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
647 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
648 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
649 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
650 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
651 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
652 #define DRV_TMR_POWER_STATE_IDX0
653 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
654 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
655 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
656 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
657 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
658 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
659 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
660 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
661 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
662 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
663 #define DRV_TMR_POWER_STATE_IDX1
664 /*** Timer Driver 2 Configuration ***/
665 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
666 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
667 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
668 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
669 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
670 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
671 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
672 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
673 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
674 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
675 #define DRV_TMR_POWER_STATE_IDX2
676 /*** Timer Driver 3 Configuration ***/
677 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
678 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
679 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
680 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
681 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
682 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
683 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
684 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
685 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
686 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
687 #define DRV_TMR_POWER_STATE_IDX3
688 /*** Timer Driver 4 Configuration ***/
689 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
690 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
691 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
692 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
693 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
694 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
695 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
696 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
697 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
698 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
699 #define DRV_TMR_POWER_STATE_IDX4
700  // *****************************************************************************
701 /* USART Driver Configuration Options
702 */
703 #define DRV_USART_INSTANCES_NUMBER 1
704 #define DRV_USART_CLIENTS_NUMBER 1
705 #define DRV_USART_INTERRUPT_MODE false
706 #define DRV_USART_BYTE_MODEL_SUPPORT true
707 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
708 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
709 // *****************************************************************************
710 // *****************************************************************************
711 // Section: Middleware & Other Library Configuration
712 // *****************************************************************************
713 // *****************************************************************************
714 /*** USB Driver Configuration ***/
715 /* Enables Device Support */
716 #define DRV_USBHS_DEVICE_SUPPORT true
717 /* Disable Host Support */
718 #define DRV_USBHS_HOST_SUPPORT false
719 /* Maximum USB driver instances */
720 #define DRV_USBHS_INSTANCES_NUMBER 1
721 /* Interrupt mode enabled */
722 #define DRV_USBHS_INTERRUPT_MODE true
723 /* Number of Endpoints used */
724 #define DRV_USBHS_ENDPOINTS_NUMBER 2
725 /*** USB Device Stack Configuration ***/
726 /* The USB Device Layer will not initialize the USB Driver */
727 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
728 /* Maximum device layer instances */
729 #define USB_DEVICE_INSTANCES_NUMBER 1
730 /* EP0 size in bytes */
731 #define USB_DEVICE_EP0_BUFFER_SIZE 64
732 /* Endpoint Transfer Queue Size combined for Read and write */
733 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
734 // *****************************************************************************
735 // *****************************************************************************
736 // Section: Application Configuration
737 // *****************************************************************************
738 // *****************************************************************************
739 /*** Application Defined Pins ***/
740 /*** Functions for LED1 pin ***/
741 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
742 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
743 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
744 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
745 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
746 /*** Functions for LED2 pin ***/
747 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
748 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
749 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
750 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
751 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
752 /*** Functions for DMP_FIRE_LED pin ***/
753 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
754 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
755 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
756 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
757 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
758 /*** Functions for HVPS_ENB pin ***/
759 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
760 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
761 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
762 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
763 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
764 /*** Functions for RLY_HVPS_OUT pin ***/
765 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
766 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
767 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
768 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
769 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
770 /*** Functions for RLY_WL_SPS_POL pin ***/
771 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
772 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
773 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
774 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
775 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
776 /*** Functions for RLY_LOG pin ***/
777 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
778 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
779 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
780 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
781 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
782 /*** Functions for RLY_DMP_FIRE pin ***/
783 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
784 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
785 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
786 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
787 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
788 /*** Functions for RLY_AUX pin ***/
789 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
790 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
791 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
792 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
793 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
794 /*** Functions for RLY_CCL pin ***/
795 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
796 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
797 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
798 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
799 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
800 /*** Functions for RLY_WL_MON pin ***/
801 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
802 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
803 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
804 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
805 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
806 /*** Functions for RLY_ARMCF pin ***/
807 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
808 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
809 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
810 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
811 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
812 /*** Functions for RLY_ARM pin ***/
813 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
814 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
815 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
816 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
817 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
818 /*** Functions for TPAN1 pin ***/
819 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
820 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
821 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
822 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
823 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
824 /*** Functions for TPAN2 pin ***/
825 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
826 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
827 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
828 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
829 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
830 /*** Functions for FSK_DAC_CS pin ***/
831 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
832 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
833 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
834 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
835 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
836 /*** Functions for RLY_COMM pin ***/
837 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
838 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
839 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
840 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
841 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
842 /*** Functions for FSK_DAC_CLR pin ***/
843 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
844 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
845 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
846 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
847 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
848 /*** Functions for WL_CPS_SW pin ***/
849 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
850 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
851 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
852 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
853 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
854 /*** Functions for HVPS_SW pin ***/
855 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
856 /*** Functions for MAN_SIG pin ***/
857 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
858 /*** Functions for DMP_FIRE_SW pin ***/
859 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
860 /*** Functions for NEG_SW pin ***/
861 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
862 /*** Functions for POS_SW pin ***/
863 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
864 /*** Functions for DRUM1_SW pin ***/
865 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
866 /*** Functions for SAFE_SW pin ***/
867 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
868 /*** Functions for DRUM2_SW pin ***/
869 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
870 /*** Functions for LOG_SW pin ***/
871 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
872 /*** Functions for AUX_SW pin ***/
873 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
874 /*** Functions for ARMCF_SW pin ***/
875 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
876 /*** Functions for ARM_SW pin ***/
877 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
878 /*** Functions for ARMCF_AUTO_SW pin ***/
879 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
880 /*** Functions for FIRE_SW_OFF pin ***/
881 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
882 /*** Functions for FIRE_SW_ON pin ***/
883 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
884 /*** Functions for WL_SPS_POS_DET pin ***/
885 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
886 /*** Functions for WL_SPS_NEG_DET pin ***/
887 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
888 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
889 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
890 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
891 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
892 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
893 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
894 /*** Application Instance 0 Configuration ***/
895 //DOM-IGNORE-BEGIN
896 //DOM-IGNORE-END
897  // _SYSTEM_CONFIG_H
898 /*******************************************************************************
899  End of File
900 */
901 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
902 /* CLOSE_FILE Include File */
903 
904 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
905 /*******************************************************************************
906  Driver Common Header Definitions
907  Company:
908  Microchip Technology Inc.
909  File Name:
910  drv_common.h
911  Summary:
912  This file defines the common macros and definitions used by the driver
913  definition and implementation headers.
914  Description:
915  This file defines the common macros and definitions used by the driver
916  definition and the implementation header.
917  Remarks:
918  The directory in which this file resides should be added to the compiler's
919  search path for header files.
920  *******************************************************************************/
921 //DOM-IGNORE-BEGIN
922 /*******************************************************************************
923 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
924 Microchip licenses to you the right to use, modify, copy and distribute
925 Software only when embedded on a Microchip microcontroller or digital signal
926 controller that is integrated into your product or third party product
927 (pursuant to the sublicense terms in the accompanying license agreement).
928 You should refer to the license agreement accompanying this Software for
929 additional information regarding your rights and obligations.
930 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
931 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
932 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
933 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
934 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
935 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
936 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
937 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
938 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
939 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
940  *******************************************************************************/
941 //DOM-IGNORE-END
942 #ifndef _DRV_COMMON_H
943 #define _DRV_COMMON_H
944 #include <stdint.h>
945 #include <stddef.h>
946 // *****************************************************************************
947 /* Device Driver I/O Intent
948  Summary:
949  Identifies the intended usage of the device when it is opened.
950  Description:
951  This enumeration identifies the intended usage of the device when the
952  caller opens the device. It identifies the desired behavior of the device
953  driver for the following:
954  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
955  block until the operation is finished or do they return immediately and
956  require the caller to call another routine to check the status of the
957  operation)
958  * Support reading and/or writing of data from/to the device
959  * Identify the buffering behavior (sometimes called "double buffering" of
960  the driver. Indicates if the driver should maintain its own read/write
961  buffers and copy data to/from these buffers to/from the caller's buffers.
962  * Identify the DMA behavior of the peripheral
963  Remarks:
964  The buffer allocation method is not identified by this enumeration. Buffers
965  can be allocated statically at build time, dynamically at run-time, or
966  even allocated by the caller and passed to the driver for its own usage if
967  a driver-specific routine is provided for such. This choice is left to
968  the design of the individual driver and is considered part of its
969  interface.
970  These values can be considered "flags". One selection from each of the
971  groups below can be ORed together to create the complete value passed
972  to the driver's open routine.
973 */
974 
975 typedef
976  enum
977  {
978  /* Read */
979  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
980  = 1 << 0 /* DOM-IGNORE-END*/
981  ,
982  /* Write */
983  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
984  = 1 << 1 /* DOM-IGNORE-END*/
985  ,
986  /* Read and Write*/
987  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
988  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
989  ,
990  /* The driver will block and will return when the operation is complete */
991  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
992  = 0 << 2 /* DOM-IGNORE-END*/
993  ,
994  /* The driver will return immediately */
995  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
996  = 1 << 2 /* DOM-IGNORE-END*/
997  ,
998  /* The driver will support only one client at a time */
999  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
1000  = 1 << 3 /* DOM-IGNORE-END*/
1001  ,
1002  /* The driver will support multiple clients at a time */
1003  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
1004  = 0 << 3 /* DOM-IGNORE-END*/
1005  } DRV_IO_INTENT ;
1006 // *****************************************************************************
1007 /* Driver Client Status
1008  Summary:
1009  Identifies the current status/state of a client's connection to a driver.
1010  Description:
1011  This enumeration identifies the current status/state of a client's link to
1012  a driver.
1013  Remarks:
1014  The enumeration used as the return type for the client-level status routines
1015  defined by each device driver or system module (for example,
1016  DRV_USART_ClientStatus) must be based on the values in this enumeration.
1017 */
1018 
1019 typedef
1020  enum
1021  {
1022  /* Indicates that a driver-specific error has occurred. */
1024  /* An unspecified error has occurred.*/
1026  /* The driver is closed, no operations for this client are ongoing,
1027  and/or the given handle is invalid. */
1029  /* The driver is currently busy and cannot start additional operations. */
1031  /* The module is running and ready for additional operations */
1033  /* Indicates that the module is in a driver-specific ready/run state. */
1035  } DRV_CLIENT_STATUS ;
1036 // *****************************************************************************
1037 /* Device Driver Blocking Status Macro
1038  Summary:
1039  Returns if the I/O intent provided is blocking
1040  Description:
1041  This macro returns if the I/O intent provided is blocking.
1042  Remarks:
1043  None.
1044 */
1045 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
1046 // *****************************************************************************
1047 /* Device Driver Non Blocking Status Macro
1048  Summary:
1049  Returns if the I/O intent provided is non-blocking.
1050  Description:
1051  This macro returns if the I/ intent provided is non-blocking.
1052  Remarks:
1053  None.
1054 */
1055 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
1056 // *****************************************************************************
1057 /* Device Driver Exclusive Status Macro
1058  Summary:
1059  Returns if the I/O intent provided is non-blocking.
1060  Description:
1061  This macro returns if the I/O intent provided is non-blocking.
1062  Remarks:
1063  None.
1064 */
1065 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
1066 // *****************************************************************************
1067 /* Device Driver IO Buffer Identifier
1068  Summary:
1069  Identifies to which buffer a device operation will apply.
1070  Description:
1071  This enumeration identifies to which buffer (read, write, both, or neither)
1072  a device operation will apply. This is used for "flush" (or similar)
1073  operations.
1074 */
1075 
1076 typedef
1077  enum
1078  {
1079  // Operation does not apply to any buffer
1081  // Operation applies to read buffer
1083  // Operation applies to write buffer
1085  // Operation applies to both read and write buffers
1088 // *****************************************************************************
1089 /* Device Handle
1090  Summary:
1091  Handle to an opened device driver.
1092  Description:
1093  This handle identifies the open instance of a device driver. It must be
1094  passed to all other driver routines (except the initialization, deinitialization,
1095  or power routines) to identify the caller.
1096  Remarks:
1097  Every application or module that wants to use a driver must first call
1098  the driver's open routine. This is the only routine that is absolutely
1099  required for every driver.
1100  If a driver is unable to allow an additional module to use it, it must then
1101  return the special value DRV_HANDLE_INVALID. Callers should check the
1102  handle returned for this value to ensure this value was not returned before
1103  attempting to call any other driver routines using the handle.
1104 */
1105 
1106 typedef
1107 uintptr_t
1109 // *****************************************************************************
1110 /* Invalid Device Handle
1111  Summary:
1112  Invalid device handle.
1113  Description:
1114  If a driver is unable to allow an additional module to use it, it must then
1115  return the special value DRV_HANDLE_INVALID. Callers should check the
1116  handle returned for this value to ensure this value was not returned before
1117  attempting to call any other driver routines using the handle.
1118  Remarks:
1119  None.
1120 */
1121 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1122 // *****************************************************************************
1123 /* Not supported configuration
1124  Summary:
1125  Not supported configuration.
1126  Description:
1127  If the configuration option is not supported on an instance of the
1128  peripheral, use this macro to equate to that configuration. This option
1129  should be listed as a possible value in the description of that
1130  configuration option.
1131 */
1132 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1133 // *****************************************************************************
1134 /* Unsupported Attribute Abstraction
1135  Summary:
1136  Abstracts the use of the unsupported attribute defined by the compiler.
1137  Description:
1138  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1139  compilation of the drivers for all different variants.
1140  Example:
1141  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1142  This function will not generate a compiler error if the interface is not
1143  defined for the selected device.
1144  Remarks:
1145  None.
1146 */
1147 #define _PLIB_UNSUPPORTED
1148  //_DRV_COMMON_H
1149 /*******************************************************************************
1150  End of File
1151 */
1152 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1153 /* CLOSE_FILE Include File */
1154 
1155 #include "system/common/sys_module.h"
1156 // *****************************************************************************
1157 /* IC Driver Module Index Numbers
1158  Summary:
1159  IC driver index definitions.
1160  Description:
1161  These constants provide IC Driver index definitions.
1162  Remarks:
1163  These constants should be used in place of hard-coded numeric literals.
1164  These values should be passed into the DRV_IC_Initialize and
1165  DRV_IC_Open routines to identify the driver instance in use.
1166 */
1167 #define DRV_IC_INDEX_0 0
1168 #define DRV_IC_INDEX_1 1
1169 #define DRV_IC_INDEX_2 2
1170 #define DRV_IC_INDEX_3 3
1171 #define DRV_IC_INDEX_4 4
1172 #define DRV_IC_INDEX_5 5
1173 #define DRV_IC_INDEX_6 6
1174 #define DRV_IC_INDEX_7 7
1175 #define DRV_IC_INDEX_8 8
1176 #define DRV_IC_INDEX_9 9
1177 #define DRV_IC_INDEX_10 10
1178 #define DRV_IC_INDEX_11 11
1179 #define DRV_IC_INDEX_12 12
1180 #define DRV_IC_INDEX_13 13
1181 #define DRV_IC_INDEX_14 14
1182 #define DRV_IC_INDEX_15 15
1183 // *****************************************************************************
1184 // *****************************************************************************
1185 // Section: Interface Headers for the static driver
1186 // *****************************************************************************
1187 // *****************************************************************************
1188 // *****************************************************************************
1189 /* Function:
1190  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1191  const SYS_MODULE_INIT * const init);
1192  Summary:
1193  Initializes the Input Capture instance for the specified driver index.
1194  <p><b>Implementation:</b> Static</p>
1195  Description:
1196  This routine initializes the Input Capture driver instance for the specified
1197  driver instance, making it ready for clients to use it. The initialization
1198  routine is specified by the MHC parameters. The driver instance index is
1199  independent of the Input Capture module ID. For example, driver instance 0
1200  can be assigned to Input Capture 2.
1201  Precondition:
1202  None.
1203  Parameters:
1204  None.
1205  Returns:
1206  None.
1207  Remarks:
1208  This routine must be called before any other Input Capture routine is called.
1209  This routine should only be called once during system initialization.
1210 */
1211 
1212 SYS_MODULE_OBJ
1214  const SYS_MODULE_INDEX index ,
1215  const SYS_MODULE_INIT * const init ) ;
1216 // *****************************************************************************
1217 /* Function:
1218 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1219  Summary:
1220  Opens the Input Capture instance for the specified driver index.
1221  <p><b>Implementation:</b> Static</p>
1222  Description:
1223  This routine starts the Input Capture driver for the specified driver
1224  index, starting an input capture.
1225  Precondition:
1226  DRV_IC_Initialize has been called.
1227  Parameters:
1228  None.
1229  Returns:
1230  None.
1231  Remarks:
1232  None.
1233 */
1234 
1235 DRV_HANDLE
1236  DRV_IC_Open (
1237  const SYS_MODULE_INDEX drvIndex ,
1238  const DRV_IO_INTENT intent ) ;
1239 // *****************************************************************************
1240 /* Function:
1241  void DRV_IC_Close(DRV_HANDLE handle)
1242  Summary:
1243  Closes the Input Capture instance for the specified driver index.
1244  <p><b>Implementation:</b> Static</p>
1245  Description:
1246  This routine stops the Input Capture driver for the specified driver
1247  index, stopping an input capture.
1248  Precondition:
1249  DRV_IC_Initialize has been called.
1250  Parameters:
1251  None.
1252  Returns:
1253  None.
1254  Remarks:
1255  None.
1256 */
1257 
1258 void
1259  DRV_IC_Close (
1260  DRV_HANDLE handle ) ;
1261 // *****************************************************************************
1262 /* Function:
1263 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1264  Summary:
1265  Starts the Input Capture instance for the specified driver index.
1266  <p><b>Implementation:</b> Static</p>
1267  Description:
1268  This routine starts the Input Capture driver for the specified driver
1269  index, starting an input capture.
1270  Precondition:
1271  DRV_IC_Initialize has been called.
1272  Parameters:
1273  None.
1274  Returns:
1275  None.
1276  Remarks:
1277  None.
1278 */
1279 
1280 DRV_HANDLE
1281  DRV_IC_Start (
1282  const SYS_MODULE_INDEX drvIndex ,
1283  const DRV_IO_INTENT intent ) ;
1284 // *****************************************************************************
1285 /* Function:
1286  void DRV_IC_Stop(DRV_HANDLE handle)
1287  Summary:
1288  Stops the Input Capture instance for the specified driver index.
1289  <p><b>Implementation:</b> Static</p>
1290  Description:
1291  This routine stops the Input Capture driver for the specified driver
1292  index, stopping an input capture.
1293  Precondition:
1294  DRV_IC_Initialize has been called.
1295  Parameters:
1296  None.
1297  Returns:
1298  None.
1299  Remarks:
1300  None.
1301 */
1302 
1303 void
1304  DRV_IC_Stop (
1305  DRV_HANDLE handle ) ;
1306 // *****************************************************************************
1307 /* Function:
1308  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1309  Summary:
1310  Reads the 32-bit Input Capture for the specified driver index.
1311  <p><b>Implementation:</b> Static</p>
1312  Description:
1313  This routine reads the 32-bit data for the specified driver index
1314  Precondition:
1315  DRV_IC_Initialize has been called.
1316  Parameters:
1317  None.
1318  Returns:
1319  uint32_t value of the data read from the Input Capture.
1320  Remarks:
1321  None.
1322 */
1323 
1324 uint32_t
1326  DRV_HANDLE handle ) ;
1327 // *****************************************************************************
1328 /* Function:
1329  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1330  Summary:
1331  Reads the 16-bit Input Capture for the specified driver index.
1332  <p><b>Implementation:</b> Static</p>
1333  Description:
1334  This routine reads the 16-bit data for the specified driver index.
1335  Precondition:
1336  DRV_IC_Initialize has been called.
1337  Parameters:
1338  None.
1339  Returns:
1340  uint16_t value of the data read from the Input Capture.
1341  Remarks:
1342  None.
1343 */
1344 
1345 uint16_t
1347  DRV_HANDLE handle ) ;
1348 // *****************************************************************************
1349 /* Function:
1350  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1351  Summary:
1352  Returns the Input Capture instance buffer empty status for the specified driver
1353  index.
1354  <p><b>Implementation:</b> Static</p>
1355  Description:
1356  Returns the Input Capture instance buffer empty status for the specified driver
1357  index. The function should be called to determine whether or not the IC buffer
1358  has data.
1359  Precondition:
1360  DRV_IC_Initialize has been called.
1361  Parameters:
1362  None.
1363  Returns:
1364  Boolean
1365  - 1 - Buffer is empty
1366  - 0 - Buffer is not empty
1367  Remarks:
1368  None.
1369 */
1370 
1371 bool
1373  DRV_HANDLE handle ) ;
1374 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1375 /*******************************************************************************
1376  IC Driver Interface Declarations for Static Single Instance Driver
1377  Company:
1378  Microchip Technology Inc.
1379  File Name:
1380  drv_ic_static.h
1381  Summary:
1382  IC driver interface declarations for the static single instance driver.
1383  Description:
1384  The IC device driver provides a simple interface to manage the IC
1385  modules on Microchip microcontrollers. This file defines the interface
1386  Declarations for the IC driver.
1387 
1388  Remarks:
1389  Static interfaces incorporate the driver instance number within the names
1390  of the routines, eliminating the need for an object ID or object handle.
1391 
1392  Static single-open interfaces also eliminate the need for the open handle.
1393 *******************************************************************************/
1394 //DOM-IGNORE-BEGIN
1395 /*******************************************************************************
1396 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1397 Microchip licenses to you the right to use, modify, copy and distribute
1398 Software only when embedded on a Microchip microcontroller or digital signal
1399 controller that is integrated into your product or third party product
1400 (pursuant to the sublicense terms in the accompanying license agreement).
1401 You should refer to the license agreement accompanying this Software for
1402 additional information regarding your rights and obligations.
1403 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1404 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1405 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1406 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1407 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1408 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1409 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1410 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1411 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1412 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1413 *******************************************************************************/
1414 //DOM-IGNORE-END
1415 #ifndef _DRV_IC_STATIC_H
1416 #define _DRV_IC_STATIC_H
1417 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1418 #define DRV_IC_Close( handle )
1419 // *****************************************************************************
1420 // *****************************************************************************
1421 // Section: Interface Headers for Instance 0 for the static driver
1422 // *****************************************************************************
1423 // *****************************************************************************
1424 
1425 void
1426  DRV_IC0_Initialize ( void ) ;
1427 
1428 void
1429  DRV_IC0_Start ( void ) ;
1430 
1431 void
1432  DRV_IC0_Stop ( void ) ;
1433 
1434 uint32_t
1435  DRV_IC0_Capture32BitDataRead ( void ) ;
1436 
1437 uint16_t
1438  DRV_IC0_Capture16BitDataRead ( void ) ;
1439 
1440 bool
1441  DRV_IC0_BufferIsEmpty ( void ) ;
1442  // #ifndef _DRV_IC_STATIC_H
1443 /*******************************************************************************
1444  End of File
1445 */
1446 
1447 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1448 /* CLOSE_FILE Include File */
1449 
1450  // #ifndef _DRV_IC_H
1451 /*******************************************************************************
1452  End of File
1453 */
1454 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1455 /* CLOSE_FILE Include File */
1456 
1457 #include "system/devcon/sys_devcon.h"
1458 #include "system/clk/sys_clk.h"
1459 #include "system/int/sys_int.h"
1460 #include "system/tmr/sys_tmr.h"
1461 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1462 /*******************************************************************************
1463  ADC Driver Interface Declarations for Static Single Instance Driver
1464  Company:
1465  Microchip Technology Inc.
1466  File Name:
1467  drv_adc_static.h
1468  Summary:
1469  ADC driver interface declarations for the static single instance driver.
1470  Description:
1471  The ADC device driver provides a simple interface to manage the ADC
1472  modules on Microchip microcontrollers. This file defines the interface
1473  Declarations for the ADC driver.
1474 
1475  Remarks:
1476  Static interfaces incorporate the driver instance number within the names
1477  of the routines, eliminating the need for an object ID or object handle.
1478 
1479  Static single-open interfaces also eliminate the need for the open handle.
1480 *******************************************************************************/
1481 //DOM-IGNORE-BEGIN
1482 /*******************************************************************************
1483 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1484 Microchip licenses to you the right to use, modify, copy and distribute
1485 Software only when embedded on a Microchip microcontroller or digital signal
1486 controller that is integrated into your product or third party product
1487 (pursuant to the sublicense terms in the accompanying license agreement).
1488 You should refer to the license agreement accompanying this Software for
1489 additional information regarding your rights and obligations.
1490 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1491 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1492 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1493 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1494 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1495 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1496 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1497 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1498 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1499 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1500 *******************************************************************************/
1501 //DOM-IGNORE-END
1502 #ifndef _DRV_ADC_STATIC_H
1503 #define _DRV_ADC_STATIC_H
1504 #include <stdbool.h>
1505 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1506 #include "peripheral/adchs/plib_adchs.h"
1507 #include "peripheral/int/plib_int.h"
1508 
1509 typedef
1510  enum
1511  {
1512  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1514  } DRV_ADC_MODULE_ID ;
1515 // *****************************************************************************
1516 // *****************************************************************************
1517 // Section: Interface Headers for ADC Static Driver
1518 // *****************************************************************************
1519 // *****************************************************************************
1520 
1521 void
1522  DRV_ADC_Initialize ( void ) ;
1523 
1524 inline void
1525  DRV_ADC_DeInitialize ( void ) ;
1526 
1527 inline void
1528  DRV_ADC0_Open ( void ) ;
1529 
1530 inline void
1531  DRV_ADC0_Close ( void ) ;
1532 
1533 inline void
1534  DRV_ADC1_Open ( void ) ;
1535 
1536 inline void
1537  DRV_ADC1_Close ( void ) ;
1538 
1539 inline void
1540  DRV_ADC_Start ( void ) ;
1541 
1542 inline void
1543  DRV_ADC_Stop ( void ) ;
1544 
1545 uint32_t
1547  uint8_t bufIndex ) ;
1548 
1549 bool
1551  uint8_t bufIndex ) ;
1552  // #ifndef _DRV_ADC_STATIC_H
1553 /*******************************************************************************
1554  End of File
1555 */
1556 
1557 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1558 /* CLOSE_FILE Include File */
1559 
1560 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1561 /*******************************************************************************
1562  Timer Driver Interface Declarations for Static Single Instance Driver
1563  Company:
1564  Microchip Technology Inc.
1565  File Name:
1566  drv_tmr_static.h
1567  Summary:
1568  Timer driver interface declarations for the static single instance driver.
1569  Description:
1570  The Timer device driver provides a simple interface to manage the Timer
1571  modules on Microchip microcontrollers. This file defines the interface
1572  Declarations for the TMR driver.
1573 
1574  Remarks:
1575  Static interfaces incorporate the driver instance number within the names
1576  of the routines, eliminating the need for an object ID or object handle.
1577 
1578  Static single-open interfaces also eliminate the need for the open handle.
1579 *******************************************************************************/
1580 //DOM-IGNORE-BEGIN
1581 /*******************************************************************************
1582 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1583 Microchip licenses to you the right to use, modify, copy and distribute
1584 Software only when embedded on a Microchip microcontroller or digital signal
1585 controller that is integrated into your product or third party product
1586 (pursuant to the sublicense terms in the accompanying license agreement).
1587 You should refer to the license agreement accompanying this Software for
1588 additional information regarding your rights and obligations.
1589 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1590 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1591 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1592 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1593 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1594 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1595 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1596 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1597 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1598 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1599 *******************************************************************************/
1600 //DOM-IGNORE-END
1601 #ifndef _DRV_TMR_STATIC_H
1602 #define _DRV_TMR_STATIC_H
1603 // *****************************************************************************
1604 // *****************************************************************************
1605 // Section: Include Headers
1606 // *****************************************************************************
1607 // *****************************************************************************
1608 #include <stdint.h>
1609 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1610 /*******************************************************************************
1611  Timer Device Driver Interface Definition
1612  Company:
1613  Microchip Technology Inc.
1614  File Name:
1615  drv_tmr.h
1616  Summary:
1617  Timer device driver interface header file.
1618  Description:
1619  This header file contains the function prototypes and definitions of the
1620  data types and constants that make up the interface to the Timer device
1621  driver.
1622 *******************************************************************************/
1623 //DOM-IGNORE-BEGIN
1624 /*******************************************************************************
1625 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1626 Microchip licenses to you the right to use, modify, copy and distribute
1627 Software only when embedded on a Microchip microcontroller or digital signal
1628 controller that is integrated into your product or third party product
1629 (pursuant to the sublicense terms in the accompanying license agreement).
1630 You should refer to the license agreement accompanying this Software for
1631 additional information regarding your rights and obligations.
1632 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1633 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1634 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1635 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1636 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1637 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1638 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1639 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1640 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1641 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1642 *******************************************************************************/
1643 //DOM-IGNORE-END
1644 #ifndef _DRV_TMR_H
1645 #define _DRV_TMR_H
1646 // *****************************************************************************
1647 // *****************************************************************************
1648 // Section: File includes
1649 // *****************************************************************************
1650 // *****************************************************************************
1651 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1652 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
1653 #include "peripheral/tmr/plib_tmr.h"
1654 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
1655 /*******************************************************************************
1656  Timer Device Driver Interface Definition
1657  Company:
1658  Microchip Technology Inc.
1659  File Name:
1660  tmr_definitions_pic32m.h
1661  Summary:
1662  Timer device driver definitions header file.
1663  Description:
1664  This header file contains the definitions of the
1665  data types and constants that make up the interface to the Timer device
1666  driver.
1667 *******************************************************************************/
1668 //DOM-IGNORE-BEGIN
1669 /*******************************************************************************
1670 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1671 Microchip licenses to you the right to use, modify, copy and distribute
1672 Software only when embedded on a Microchip microcontroller or digital signal
1673 controller that is integrated into your product or third party product
1674 (pursuant to the sublicense terms in the accompanying license agreement).
1675 You should refer to the license agreement accompanying this Software for
1676 additional information regarding your rights and obligations.
1677 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1678 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1679 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1680 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1681 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1682 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1683 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1684 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1685 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1686 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1687 *******************************************************************************/
1688 //DOM-IGNORE-END
1689 #ifndef _TMR_DEFINITIONS_PIC32M_H
1690 #define _TMR_DEFINITIONS_PIC32M_H
1691 // DOM-IGNORE-BEGIN
1692 // DOM-IGNORE-END
1693 
1694 typedef
1695  enum
1696  {
1697  /* Clock input to the timer module is internal(Peripheral Clock) */
1699  /*DOM-IGNORE-BEGIN*/
1700  = 0x00 /*DOM-IGNORE-END*/
1701  ,
1702  /* Clock input to the timer module is from T1CK pin (external)
1703  with clock synchronization enabled */
1705  /*DOM-IGNORE-BEGIN*/
1706  = 0x01 /*DOM-IGNORE-END*/
1707  ,
1708  /* Clock input to the timer module is from T1CK pin (external)
1709  with clock synchronization disabled */
1711  /*DOM-IGNORE-BEGIN*/
1712  = 0x11 /*DOM-IGNORE-END*/
1713  ,
1714  /* Clock input to the timer module is from secondary oscillator (external)
1715  with clock synchronization enabled */
1717  /*DOM-IGNORE-BEGIN*/
1718  = 0x02 /*DOM-IGNORE-END*/
1719  ,
1720  /* Clock input to the timer module is from secondary oscillator (external)
1721  with clock synchronization disabled */
1723  /*DOM-IGNORE-BEGIN*/
1724  = 0x12 /*DOM-IGNORE-END*/
1725  ,
1726  /* Clock input to the timer module is from LPRC
1727  with clock synchronization enabled */
1729  /*DOM-IGNORE-BEGIN*/
1730  = 0x03 /*DOM-IGNORE-END*/
1731  ,
1732  /* Clock input to the timer module is from LPRC
1733  with clock synchronization disabled */
1735  /*DOM-IGNORE-BEGIN*/
1736  = 0x13 /*DOM-IGNORE-END*/
1738 //DOM-IGNORE-BEGIN
1739 //DOM-IGNORE-END
1740  // #ifndef _DRV_TMR_H
1741 /*******************************************************************************
1742  End of File
1743 */
1744 
1745 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
1746 /* CLOSE_FILE Include File */
1747 
1748 #include "system/int/sys_int.h" // System Interrupt Definitions
1749 #include "system/clk/sys_clk.h"
1750 // DOM-IGNORE-BEGIN
1751 // DOM-IGNORE-END
1752 // *****************************************************************************
1753 // *****************************************************************************
1754 // Section: TMR Driver Data Types
1755 // *****************************************************************************
1756 // *****************************************************************************
1757 // *****************************************************************************
1758 /* Timer Driver Module Index Numbers
1759  Summary:
1760  Timer driver index definitions
1761  Description:
1762  These constants provide Timer driver index definitions.
1763  Remarks:
1764  These constants should be used in place of hard-coded numeric literals.
1765  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
1766  functions to identify the driver instance in use.
1767 */
1768 #define DRV_TMR_INDEX_0 0
1769 #define DRV_TMR_INDEX_1 1
1770 #define DRV_TMR_INDEX_2 2
1771 #define DRV_TMR_INDEX_3 3
1772 #define DRV_TMR_INDEX_4 4
1773 #define DRV_TMR_INDEX_5 5
1774 #define DRV_TMR_INDEX_6 6
1775 #define DRV_TMR_INDEX_7 7
1776 #define DRV_TMR_INDEX_8 8
1777 #define DRV_TMR_INDEX_9 9
1778 #define DRV_TMR_INDEX_10 10
1779 #define DRV_TMR_INDEX_11 11
1780 // *****************************************************************************
1781 /* Timer Driver Module Index Count
1782  Summary:
1783  Number of valid Timer driver indices.
1784  Description:
1785  This constant identifies Timer driver index definitions.
1786  Remarks:
1787  This constant should be used in place of hard-coded numeric literals.
1788  This value is device-specific.
1789 */
1790 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
1791 // *****************************************************************************
1792 /* Timer Driver Client Status
1793  Summary:
1794  Identifies the client-specific status of the Timer driver
1795  Description:
1796  This enumeration identifies the client-specific status of the Timer driver.
1797  Remarks:
1798  None.
1799 */
1800 
1801 typedef
1802  enum
1803  {
1804  /* Driver is invalid (or unopened) state */
1806  /*DOM-IGNORE-BEGIN*/
1807  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
1808  ,
1809  /* An operation is currently in progress */
1811  /*DOM-IGNORE-BEGIN*/
1812  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
1813  ,
1814  /* Ready, no operations running */
1816  /*DOM-IGNORE-BEGIN*/
1817  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
1818  ,
1819  /* Timer started and running, processing transactions */
1821  /*DOM-IGNORE-BEGIN*/
1822  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
1824 // *****************************************************************************
1825 /* Timer Driver Clock sources
1826  Summary:
1827  Lists the clock sources available for timer driver.
1828  Description:
1829  This enumeration lists all the available clock sources for the timer
1830  hardware.
1831  Remarks:
1832  Not all modes are available on all devices.
1833  'Synchronization' may not be applicable for all the instances of the timer.
1834  The driver discards the Synchronization mode selected if it is not
1835  applicable for the selected hardware.
1836 */
1837 // *****************************************************************************
1838 /* Timer Driver Operation mode
1839  Summary:
1840  Lists the operation modes available for timer driver.
1841  Description:
1842  This enumeration lists all the available operation modes that are valid for
1843  the timer hardware.
1844  Remarks:
1845  Not all modes are available on all devices.
1846 */
1847 
1848 typedef
1849  enum
1850  {
1851  /* The timer module operating mode none/invalid */
1853  /* The timer module operates in 16 bit mode */
1855  /* The timer module operates in 32 bit mode */
1856  /* This will combine two 16 bit timer modules */
1859 // *****************************************************************************
1860 /* Timer Driver divider operating specification
1861  Summary:
1862  This data structure specifies the divider values that can be obtained by the
1863  timer module.
1864  Description:
1865  This data structure specifies the divider values that can be obtained by the
1866  timer hardware.
1867  Remarks:
1868  None.
1869 */
1870 
1871 typedef
1872  struct
1873  {
1874  /* The minimum divider value that the timer module can obtain */
1875  uint32_t dividerMin ;
1876  /* The maximum divider value that the timer module can obtain */
1877  uint32_t dividerMax ;
1878  /* The divider step value, between 2 divider values */
1879  /* Should be 1 for most timers */
1880  uint32_t dividerStep ;
1882 // *****************************************************************************
1883 /* Timer Driver Initialize Data
1884  Summary:
1885  Defines the Timer driver initialization data.
1886  Description:
1887  This data type defines data required to initialize the Timer driver.
1888  Remarks:
1889  Not all initialization features are available on all devices.
1890 */
1891 
1892 typedef
1893  struct
1894  {
1895  /* System module initialization. */
1896  SYS_MODULE_INIT moduleInit ;
1897  /* Identifies timer hardware module (PLIB-level) ID */
1898  TMR_MODULE_ID tmrId ;
1899  /* Clock Source select. */
1901  /* Prescaler Selection from the processor enumeration */
1902  TMR_PRESCALE prescale ;
1903  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
1904  is selected the interrupt will be generated by the 2nd timer of the pair,
1905  the odd numbered one. */
1906  INT_SOURCE interruptSource ;
1907  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
1908  timer modules to form a 32 bit one. This is usually only necessary for
1909  very long delays. */
1911  /* Asynchronous write enable configuration. If true the asynchronous write
1912  is enabled. For timers that do not support this feature the value is
1913  ignored */
1915  } DRV_TMR_INIT ;
1916 // *****************************************************************************
1917 /* Timer Driver Callback Function Pointer
1918  Summary:
1919  Pointer to a Timer driver callback function data type.
1920  Description:
1921  This data type defines a pointer to a Timer driver callback function.
1922  Remarks:
1923  Useful only when timer alarm callback support is enabled by defining the
1924  DRV_TMR_ALARM_ENABLE configuration option.
1925 */
1926 
1927 typedef
1928 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
1929 uint32_t alarmCount ) ;
1930 // *****************************************************************************
1931 // *****************************************************************************
1932 // Section: Timer Driver Module Interface Functions
1933 // *****************************************************************************
1934 // *****************************************************************************
1935 // *****************************************************************************
1936 /* Function:
1937  SYS_MODULE_OBJ DRV_TMR_Initialize
1938  (
1939  const SYS_MODULE_INDEX drvIndex,
1940  const SYS_MODULE_INIT * const init
1941  )
1942  Summary:
1943  Initializes the Timer driver.
1944  <p><b>Implementation:</b> Static/Dynamic</p>
1945  Description:
1946  This function initializes the Timer driver, making it ready for clients to
1947  open and use it.
1948  Precondition:
1949  None.
1950  Parameters:
1951  drvIndex - Index for the driver instance to be initialized
1952  init - Pointer to a data structure containing any data necessary
1953  to initialize the driver.
1954  Returns:
1955  If successful, returns a valid handle to a driver object. Otherwise, it
1956  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
1957  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
1958  Example:
1959  <code>
1960  DRV_TMR_INIT init;
1961  SYS_MODULE_OBJ objectHandle;
1962  // Populate the timer initialization structure
1963  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
1964  init.tmrId = TMR_ID_2;
1965  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
1966  init.prescale = TMR_PRESCALE_VALUE_256;
1967  init.interruptSource = INT_SOURCE_TIMER_2;
1968  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
1969  init.asyncWriteEnable = false;
1970  // Do something
1971  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
1972  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
1973  {
1974  // Handle error
1975  }
1976  </code>
1977  Remarks:
1978  This function must be called before any other Timer driver function is
1979  called.
1980  This function should only be called once during system initialization unless
1981  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
1982  This function will NEVER block for hardware access. The system must use
1983  DRV_TMR_Status to find out when the driver is in the ready state.
1984  Build configuration options may be used to statically override options in
1985  the "init" structure and will take precedence over initialization data
1986  passed using this function.
1987 */
1988 
1989 SYS_MODULE_OBJ
1991  const SYS_MODULE_INDEX drvIndex ,
1992  const SYS_MODULE_INIT * const init ) ;
1993 // *****************************************************************************
1994 /* Function:
1995  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
1996  Summary:
1997  Deinitializes the specified instance of the Timer driver.
1998  <p><b>Implementation:</b> Dynamic</p>
1999  Description:
2000  Deinitializes the specified instance of the Timer driver, disabling
2001  its operation (and any hardware). All internal data is invalidated.
2002  Precondition:
2003  The DRV_TMR_Initialize function must have been called before calling this
2004  function and a valid SYS_MODULE_OBJ must have been returned.
2005  Parameters:
2006  object - Driver object handle, returned from DRV_TMR_Initialize
2007  Returns:
2008  None.
2009  Example:
2010  <code>
2011  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
2012  SYS_STATUS tmrStatus;
2013  DRV_TMR_Deinitialize ( tmrObject );
2014  tmrStatus = DRV_TMR_Status ( tmrObject );
2015  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
2016  {
2017  // Check again later if you need to know
2018  // when the driver is deinitialized.
2019  }
2020  </code>
2021  Remarks:
2022  Once the Initialize operation has been called, the Deinitialize operation
2023  must be called before the Initialize operation can be called again.
2024  This function will NEVER block waiting for hardware. If the operation
2025  requires time to allow the hardware to complete, this will be reported by
2026  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
2027  out when the module is in the ready state.
2028 */
2029 
2030 void
2032  SYS_MODULE_OBJ object ) ;
2033 // *****************************************************************************
2034 /* Function:
2035  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
2036  Summary:
2037  Provides the current status of the Timer driver.
2038  <p><b>Implementation:</b> Dynamic</p>
2039  Description:
2040  This function provides the current status of the Timer driver.
2041  Precondition:
2042  The DRV_TMR_Initialize function must have been called before calling this
2043  function.
2044  Parameters:
2045  object - Driver object handle, returned from DRV_TMR_Initialize
2046  Returns:
2047  SYS_STATUS_READY - Indicates that the driver is initialized and ready
2048  for operation
2049  Note: Any value greater than SYS_STATUS_READY is
2050  also a normal running state in which the driver
2051  is ready to accept new operations.
2052  SYS_STATUS_ERROR - Indicates that the driver is in an error state
2053  Note: Any value less than SYS_STATUS_ERROR is
2054  also an error state.
2055  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
2056  Note: This value is less than SYS_STATUS_ERROR.
2057  Example:
2058  <code>
2059  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2060  SYS_STATUS tmrStatus;
2061  tmrStatus = DRV_TMR_Status ( object );
2062  else if ( SYS_STATUS_ERROR >= tmrStatus )
2063  {
2064  // Handle error
2065  }
2066  </code>
2067  Remarks:
2068  The this operation can be used to determine when any of the driver's module
2069  level operations has completed.
2070  Once the status operation returns SYS_STATUS_READY, the driver is ready for
2071  operation.
2072  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
2073  also an error state.
2074  This function will NEVER block waiting for hardware.
2075 */
2076 
2077 SYS_STATUS
2078  DRV_TMR_Status (
2079  SYS_MODULE_OBJ object ) ;
2080 // *****************************************************************************
2081 /* Function:
2082  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
2083  Summary:
2084  Maintains the driver's state machine.
2085  <p><b>Implementation:</b> Dynamic</p>
2086  Description:
2087  This function is used to maintain the driver's internal state machine and
2088  processes the timer events..
2089  Precondition:
2090  The DRV_TMR_Initialize function must have been called for the specified Timer
2091  driver instance.
2092  Parameters:
2093  object - Object handle for the specified driver instance (returned from
2094  DRV_TMR_Initialize)
2095  Returns:
2096  None
2097  Example:
2098  <code>
2099  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2100  while (true)
2101  {
2102  DRV_TMR_Tasks ( object );
2103  // Do other tasks
2104  }
2105  </code>
2106  Remarks:
2107  This function is normally not called directly by an application. It is
2108  called by the system's Tasks routine (SYS_Tasks)
2109 */
2110 
2111 void
2112  DRV_TMR_Tasks (
2113  SYS_MODULE_OBJ object ) ;
2114 // *****************************************************************************
2115 // *****************************************************************************
2116 // Section: TMR Driver Client Functions
2117 // *****************************************************************************
2118 // *****************************************************************************
2119 // *****************************************************************************
2120 /* Function:
2121  DRV_HANDLE DRV_TMR_Open
2122  (
2123  const SYS_MODULE_INDEX index,
2124  const DRV_IO_INTENT intent
2125  )
2126  Summary:
2127  Opens the specified Timer driver instance and returns a handle to it.
2128  <p><b>Implementation:</b> Dynamic</p>
2129  Description:
2130  This function opens the specified Timer driver instance and provides a
2131  handle that must be provided to all other client-level operations to
2132  identify the caller and the instance of the driver. Timer driver does not
2133  support multiple clients. If two tasks want to use the timer, one should
2134  wait until the other one gets closed.
2135  Precondition:
2136  The DRV_TMR_Initialize function must have been called before calling this
2137  function.
2138  Parameters:
2139  index - Identifier for the object instance to be opened
2140  intent - Zero or more of the values from the enumeration
2141  DRV_IO_INTENT ORed together to indicate the intended use
2142  of the driver
2143  Returns:
2144  If successful, the function returns a valid open instance handle (a number
2145  identifying both the caller and the module instance).
2146  If an error occurs, the return value is DRV_HANDLE_INVALID.
2147  Example:
2148  <code>
2149  DRV_HANDLE handle;
2150  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2151  if ( DRV_HANDLE_INVALID == handle )
2152  {
2153  // Unable to open the driver
2154  }
2155  </code>
2156  Remarks:
2157  The handle returned is valid until the DRV_TMR_Close function is called.
2158  This function will NEVER block waiting for hardware.
2159  If the requested intent flags are not supported, the function will return
2160  DRV_HANDLE_INVALID.
2161  The Timer driver does not support DRV_IO_INTENT_SHARED.
2162  Only exclusive access is supported for now.
2163 */
2164 
2165 DRV_HANDLE
2166  DRV_TMR_Open (
2167  const SYS_MODULE_INDEX index ,
2168  const DRV_IO_INTENT intent ) ;
2169 // *****************************************************************************
2170 /* Function:
2171  void DRV_TMR_Close ( DRV_HANDLE handle )
2172  Summary:
2173  Closes an opened instance of the Timer driver.
2174  <p><b>Implementation:</b> Dynamic</p>
2175  Description:
2176  This function closes an opened instance of the Timer driver, invalidating
2177  the handle.
2178  Precondition:
2179  The DRV_TMR_Initialize function must have been called for the specified
2180  Timer driver instance.
2181  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2182  Parameters:
2183  handle - A valid open-instance handle, returned from the driver's
2184  open routine
2185  Returns:
2186  None
2187  Example:
2188  <code>
2189  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2190  DRV_TMR_Close ( handle );
2191  </code>
2192  Remarks:
2193  After calling this function, the handle passed in "handle" must not be used
2194  with any of the remaining driver functions. A new handle must be obtained
2195  by calling DRV_TMR_Open before the caller may use the driver again.
2196  Note: Usually there is no need for the driver client to verify that the Close
2197  operation has completed.
2198 */
2199 
2200 void
2201  DRV_TMR_Close (
2202  DRV_HANDLE handle ) ;
2203 // *****************************************************************************
2204 /* Function:
2205  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2206  Summary:
2207  Gets the status of the client operation.
2208  <p><b>Implementation:</b> Dynamic</p>
2209  Description:
2210  This function gets the status of the recently completed client level
2211  operation.
2212  Precondition:
2213  The DRV_TMR_Initialize function must have been called for the specified
2214  Timer driver instance.
2215  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2216  Parameters:
2217  handle - A valid open-instance handle, returned from the driver's
2218  open routine
2219  Returns:
2220  None
2221  Example:
2222  <code>
2223  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2224  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2225  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2226  </code>
2227  Remarks:
2228  None.
2229 */
2230 
2233  DRV_HANDLE handle ) ;
2234 // *****************************************************************************
2235 // *****************************************************************************
2236 // Section: TMR Driver Counting functions
2237 // *****************************************************************************
2238 // *****************************************************************************
2239 // *****************************************************************************
2240 /* Function:
2241  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2242  Summary:
2243  Updates the Timer's counter register.
2244  <p><b>Implementation:</b> Static/Dynamic</p>
2245  Description:
2246  This function updates the Timer's value in the counter register.
2247  Precondition:
2248  The DRV_TMR_Initialize function must have been called.
2249  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2250  Parameters:
2251  handle - A valid open-instance handle, returned from the driver's
2252  open routine
2253  counterPeriod - counter period value
2254  - a 16 bit value if the timer is configured in 16 bit mode
2255  - a 32 bit value if the timer is configured in 32 bit mode
2256  Returns:
2257  None.
2258  Example:
2259  <code>
2260  </code>
2261  Remarks:
2262  None.
2263 */
2264 
2265 void
2267  DRV_HANDLE handle ,
2268  uint32_t counterPeriod ) ;
2269 // *****************************************************************************
2270 /* Function:
2271  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2272  Summary:
2273  Reads the Timer's counter register.
2274  <p><b>Implementation:</b> Static/Dynamic</p>
2275  Description:
2276  This function returns the Timer's value in the counter register.
2277  Precondition:
2278  The DRV_TMR_Initialize function must have been called.
2279  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2280  Parameters:
2281  handle - A valid open-instance handle, returned from the driver's
2282  open routine
2283  Returns:
2284  Timer current period:
2285  - a 16 bit value if the timer is configured in 16 bit mode
2286  - a 32 bit value if the timer is configured in 32 bit mode
2287  Example:
2288  <code>
2289  //Example to use timer for precision time measurement
2290  //without configuring an alarm (interrupt based)
2291  char appState = 0;
2292  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2293  switch ( appState )
2294  {
2295  case 0:
2296  //Calculate and set the counter period
2297  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2298  //counter starts
2299  DRV_TMR_Start ( tmrHandle );
2300  //Trigger an application operation
2301  app_trigger_operation();
2302  //Check for time-out in the next state
2303  appState++;
2304  case 1:
2305  //Overflows and stops at 0 if no alarm is set
2306  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2307  {
2308  //Time-out
2309  return false;
2310  }
2311  else if ( app_operation_isComplete( ) )
2312  {
2313  //Operation is complete before time-out
2314  return true;
2315  }
2316  </code>
2317  Remarks:
2318  None.
2319 */
2320 
2321 uint32_t
2323  DRV_HANDLE handle ) ;
2324 // *****************************************************************************
2325 /* Function:
2326  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2327  Summary:
2328  Clears the Timer's counter register.
2329  <p><b>Implementation:</b> Static/Dynamic</p>
2330  Description:
2331  This function clears the Timer's value in the counter register.
2332  Precondition:
2333  The DRV_TMR_Initialize function must have been called.
2334  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2335  Parameters:
2336  handle - A valid open-instance handle, returned from the driver's
2337  open routine
2338  Returns:
2339  None.
2340  Example:
2341  <code>
2342  </code>
2343  Remarks:
2344  None.
2345 */
2346 
2347 void
2349  DRV_HANDLE handle ) ;
2350 // *****************************************************************************
2351 /* Function:
2352  bool DRV_TMR_AlarmRegister
2353  (
2354  DRV_HANDLE handle,
2355  uint32_t divider,
2356  bool isPeriodic,
2357  uintptr_t context,
2358  DRV_TMR_CALLBACK callBack
2359  )
2360  Summary:
2361  Sets up an alarm.
2362  <p><b>Implementation:</b> Dynamic</p>
2363  Description:
2364  This function sets up an alarm, allowing the client to receive a callback
2365  from the driver when the timer counter reaches zero. Alarms can be one-shot
2366  or periodic. A periodic alarm will reload the timer and generate alarm
2367  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2368  divider;
2369  Precondition:
2370  The DRV_TMR_Initialize function must have been called.
2371  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2372  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2373  Parameters:
2374  handle - A valid handle, returned from DRV_TMR_Open
2375  divider - The value to divide the timer clock source to obtain the
2376  required alarm frequency.
2377  - a 16 bit value if the timer is configured in 16 bit mode
2378  - a 32 bit value if the timer is configured in 32 bit mode
2379  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2380  context - A reference, call back function will be called with the same
2381  reference.
2382  callBack - A call back function which will be called on time out.
2383  Returns:
2384  - true - if the call succeeded
2385  - false - the obtained divider could not be obtained or the passed handle was invalid
2386  Example:
2387  <code>
2388  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2389  void setupTask ()
2390  {
2391  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2392  uint32_t myFreq = 1000; // 1KHz
2393  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2394  // calculate the divider needed
2395  uint32_t divider = clkFreq / myFreq;
2396  // Start the alarm
2397  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2398  {
2399  // divider value could not be obtain;
2400  // handle the error
2401  //
2402  }
2403  }
2404  </code>
2405  Remarks:
2406  The divider value will be truncated to a 16 bit value if the timer is
2407  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2408  callback.
2409 */
2410 
2411 bool
2413  DRV_HANDLE handle ,
2414  uint32_t divider ,
2415  bool isPeriodic ,
2416  uintptr_t context ,
2417  DRV_TMR_CALLBACK callBack ) ;
2418 // *****************************************************************************
2419 /* Function:
2420  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2421  Summary:
2422  Disables an alarm signal.
2423  <p><b>Implementation:</b> Dynamic</p>
2424  Description:
2425  This function allows the client to disable an alarm generation.
2426  Use DRV_TMR_AlarmEnable to re-enable.
2427  Precondition:
2428  The DRV_TMR_Initialize function must have been called.
2429  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2430  A client alarm must be active.
2431  Parameters:
2432  handle - A valid handle, returned from DRV_TMR_Open
2433  Returns:
2434  The current status of the alarm:
2435  - true if the alarm was currently enabled
2436  - false if the alarm was currently disabled
2437  Example:
2438  <code>
2439  </code>
2440  Remarks:
2441  When the driver operates in interrupts this call resolves to a device
2442  interrupt disable.
2443  Do NOT disable the timer except for very short periods of time. If the time
2444  that the interrupt is disabled is longer than a wrap around period and the
2445  interrupt is missed, the hardware has no means of recovering and the
2446  resulting timing will be inaccurate.
2447 */
2448 
2449 bool
2451  DRV_HANDLE handle ) ;
2452 // *****************************************************************************
2453 /* Function:
2454  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2455  Summary:
2456  Re-enables an alarm signal.
2457  <p><b>Implementation:</b> Dynamic</p>
2458  Description:
2459  This function allows the client to re-enable an alarm after it has been
2460  disabled by a DRV_TMR_AlarmDisable call.
2461  Precondition:
2462  The DRV_TMR_Initialize function must have been called.
2463  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2464  Parameters:
2465  handle - A valid handle, returned from DRV_TMR_Open
2466  enable - boolean to enable the current callback
2467  Returns:
2468  None
2469  Example:
2470  <code>
2471  </code>
2472  Remarks:
2473  When the driver operates in interrupts this call resolves to a device
2474  interrupt re-enable.
2475 */
2476 
2477 void
2479  DRV_HANDLE handle ,
2480  bool enable ) ;
2481 // *****************************************************************************
2482 /* Function:
2483  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2484  Summary:
2485  Updates the Timer's period.
2486  <p><b>Implementation:</b> Dynamic</p>
2487  Description:
2488  This function updates the Timer's period.
2489  Precondition:
2490  The DRV_TMR_Initialize function must have been called.
2491  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2492  Parameters:
2493  handle - A valid open-instance handle, returned from the driver's
2494  open routine
2495  value - Period value
2496  - a 16 bit value if the timer is configured in 16 bit mode
2497  - a 32 bit value if the timer is configured in 32 bit mode
2498  Returns:
2499  None.
2500  Example:
2501  <code>
2502  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2503  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2504  </code>
2505  Remarks:
2506  - The period value will be truncated to a 16 bit value if the timer is
2507  configured in 16 bit mode.
2508 */
2509 
2510 void
2512  DRV_HANDLE handle ,
2513  uint32_t value ) ;
2514 // *****************************************************************************
2515 /* Function:
2516  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2517  Summary:
2518  Provides the Timer's period.
2519  <p><b>Implementation:</b> Dynamic</p>
2520  Description:
2521  This function gets the Timer's period.
2522  Precondition:
2523  The DRV_TMR_Initialize function must have been called.
2524  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2525  Parameters:
2526  handle - A valid open-instance handle, returned from the driver's
2527  open routine
2528  Returns:
2529  Timer period value:
2530  - a 16 bit value if the timer is configured in 16 bit mode
2531  - a 32 bit value if the timer is configured in 32 bit mode
2532  Example:
2533  <code>
2534  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2535  uint32_t period;
2536  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2537  </code>
2538  Remarks:
2539  None.
2540 */
2541 
2542 uint32_t
2544  DRV_HANDLE handle ) ;
2545 // *****************************************************************************
2546 /* Function:
2547  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2548  Summary:
2549  Removes a previously set alarm.
2550  <p><b>Implementation:</b> Dynamic</p>
2551  Description:
2552  This function removes a previously set alarm.
2553  Precondition:
2554  The DRV_TMR_Initialize function must have been called.
2555  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2556  DRV_TMR_AlarmRegister function must have been called before.
2557  Parameters:
2558  handle - A valid open-instance handle, returned from the driver's
2559  open routine
2560  Returns:
2561  None.
2562  Example:
2563  <code>
2564  // Example of a key debounce check
2565  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2566  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2567  void keyPressDetect ()
2568  {
2569  // Calculate the count to be passed on from the clock input
2570  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2571  }
2572  void DebounceCheck ( uintptr_t context )
2573  {
2574  readKey = AppReadKey();
2575  if ( readKey != lastReadKey )
2576  {
2577  lastReadKey = readKey;
2578  keyCount = 0;
2579  }
2580  else
2581  {
2582  if ( keyCount > 20 )
2583  {
2584  globalKeyState = readKey;
2585  DRV_TMR_AlarmDeregister ( tmrHandle );
2586  }
2587  keyCount++;
2588  }
2589  }
2590  </code>
2591  Remarks:
2592  None.
2593 */
2594 
2595 void
2597  DRV_HANDLE handle ) ;
2598 // *****************************************************************************
2599 // *****************************************************************************
2600 // Section: TMR Driver Operation Control Functions
2601 // *****************************************************************************
2602 // *****************************************************************************
2603 // *****************************************************************************
2604 /* Function:
2605  bool DRV_TMR_Start ( DRV_HANDLE handle )
2606  Summary:
2607  Starts the Timer counting.
2608  <p><b>Implementation:</b> Static/Dynamic</p>
2609  Description:
2610  This function starts the Timer counting.
2611  Precondition:
2612  The DRV_TMR_Initialize function must have been called.
2613  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2614  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2615  Parameters:
2616  handle - A valid open-instance handle, returned from the driver's
2617  open routine
2618  Returns:
2619  - true - if the operation succeeded
2620  - false - the supplied handle is invalid or the client doesn't have
2621  the needed parameters to run (alarm callback and period )
2622  Example:
2623  <code>
2624  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2625  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2626  DRV_TMR_Start ( tmrHandle );
2627  </code>
2628  Remarks:
2629  None.
2630 */
2631 
2632 bool
2633  DRV_TMR_Start (
2634  DRV_HANDLE handle ) ;
2635 // *****************************************************************************
2636 /* Function:
2637  void DRV_TMR_Stop ( DRV_HANDLE handle )
2638  Summary:
2639  Stops the Timer from counting.
2640  <p><b>Implementation:</b> Static/Dynamic</p>
2641  Description:
2642  This function stops the running Timer from counting.
2643  Precondition:
2644  The DRV_TMR_Initialize function must have been called.
2645  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2646  Parameters:
2647  handle - A valid open-instance handle, returned from the driver's
2648  open routine
2649  Returns:
2650  None.
2651  Example:
2652  <code>
2653  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2654  DRV_TMR_Stop ( handle );
2655  </code>
2656  Remarks:
2657  None.
2658 */
2659 
2660 void
2661  DRV_TMR_Stop (
2662  DRV_HANDLE handle ) ;
2663 // *****************************************************************************
2664 // *****************************************************************************
2665 // Section: TMR Driver Operation Status Functions
2666 // *****************************************************************************
2667 // *****************************************************************************
2668 // *****************************************************************************
2669 /* Function:
2670  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
2671  Summary:
2672  Provides the status of Timer's period elapse.
2673  <p><b>Implementation:</b> Dynamic</p>
2674  Description:
2675  This function returns the number of times Timer's period has elapsed since
2676  last call to this API has made. On calling this API, the internally
2677  maintained counter will be cleared and count will be started again from next
2678  elapse.
2679  Precondition:
2680  The DRV_TMR_Initialize function must have been called.
2681  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2682  Parameters:
2683  handle - A valid handle, returned from the DRV_TMR_Open
2684  Returns:
2685  Number of times timer has elapsed since the last call.
2686  Example:
2687  <code>
2688  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2689  bool elapseStatus;
2690  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
2691  unsigned int appInternalTime = 0;
2692  Sys_Tasks()
2693  {
2694  //Timer task will be called from ISR
2695  APP_TimeUpdate_Task();
2696  //Other Tasks
2697  }
2698  void APP_TimeUpdate_Task ( void )
2699  {
2700  //We will not miss a count even though we are late
2701  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
2702  }
2703  </code>
2704  Remarks:
2705  None.
2706 */
2707 
2708 uint32_t
2710  DRV_HANDLE handle ) ;
2711 // *****************************************************************************
2712 // *****************************************************************************
2713 // Section: TMR Driver Control and Information Functions
2714 // *****************************************************************************
2715 // *****************************************************************************
2716 // *****************************************************************************
2717 /* Function:
2718  bool DRV_TMR_ClockSet
2719  (
2720  DRV_HANDLE handle,
2721  DRV_TMR_CLK_SOURCES clockSource,
2722  TMR_PRESCALE preScale
2723  )
2724  Summary:
2725  Sets the timers clock by selecting the source and prescaler.
2726  <p><b>Implementation:</b> Dynamic</p>
2727  Description:
2728  This function sets the timer clock by selecting the source and prescaler.
2729  The clock sources are device specific, refer device datasheet for supported
2730  clock sources. If unsupported clock source is passed then the behaviour of
2731  this function is unpredictable.
2732  Precondition:
2733  The DRV_TMR_Initialize function must have been called. Must have selected
2734  32-Bit timer mode if mode selection is applicable.
2735  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2736  Parameters:
2737  handle - A valid open-instance handle, returned from the driver's
2738  open routine
2739  clockSource - Clock source of the timer
2740  preScale - Timer's Prescaler divisor
2741  Returns:
2742  - true - if the operation is successful
2743  - false - either the handle is invalid or the clockSource
2744  and/or prescaler are not supported
2745  Example:
2746  <code>
2747  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2748  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
2749  </code>
2750  Remarks:
2751  None.
2752 */
2753 
2754 bool
2756  DRV_HANDLE handle ,
2757  DRV_TMR_CLK_SOURCES clockSource ,
2758  TMR_PRESCALE preScale ) ;
2759 // *****************************************************************************
2760 /* Function:
2761  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
2762  Summary:
2763  This function gets the currently selected prescaler.
2764  <p><b>Implementation:</b> Dynamic</p>
2765  Description:
2766  This function gets the currently selected prescaler.
2767  Precondition:
2768  The DRV_TMR_Initialize function must have been called.
2769  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2770  Parameters:
2771  handle - A valid open-instance handle, returned from the driver's
2772  open routine
2773  Returns:
2774  Timer prescaler.
2775  Example:
2776  <code>
2777  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2778  TMR_PRESCALE preScale;
2779  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
2780  </code>
2781  Remarks:
2782  None.
2783 */
2784 
2785 TMR_PRESCALE
2787  DRV_HANDLE handle ) ;
2788 // *****************************************************************************
2789 /* Function:
2790  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
2791  Summary:
2792  This function gets the currently selected operation mode.
2793  <p><b>Implementation:</b> Dynamic</p>
2794  Description:
2795  This function gets the currently selected 16/32 bit operation mode.
2796  Precondition:
2797  The DRV_TMR_Initialize function must have been called.
2798  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2799  Parameters:
2800  handle - A valid open-instance handle, returned from the driver's
2801  open routine
2802  Returns:
2803  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
2804  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
2805  handle.
2806  Example:
2807  <code>
2808  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2809  DRV_TMR_OPERATION_MODE operMode;
2810  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
2811  </code>
2812  Remarks:
2813  None.
2814 */
2815 
2818  DRV_HANDLE handle ) ;
2819 // *****************************************************************************
2820 /* Function:
2821  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
2822  Summary:
2823  Enables the Gate mode.
2824  <p><b>Implementation:</b> Dynamic</p>
2825  Description:
2826  This function enables the Gated mode of Timer. User can measure the duration
2827  of an external signal in this mode. Once the Gate mode is enabled, Timer
2828  will start on the raising edge of the external signal. It will keep counting
2829  until the next falling edge.
2830  Precondition:
2831  The DRV_TMR_Initialize function must have been called.
2832  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2833  Parameters:
2834  handle - A valid open-instance handle, returned from the driver's
2835  open routine
2836  Returns:
2837  - true - if the operation is successful
2838  - false - either the handle is invalid or the gate mode
2839  is not supported
2840  Example:
2841  <code>
2842  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2843  DRV_TMR_GateModeSet ( tmrHandle );
2844  </code>
2845  Remarks:
2846  None.
2847 */
2848 
2849 bool
2851  DRV_HANDLE handle ) ;
2852 // *****************************************************************************
2853 /* Function:
2854  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
2855  Summary:
2856  Enables the Gate mode.
2857  <p><b>Implementation:</b> Dynamic</p>
2858  Description:
2859  This function enables the Gated mode of Timer. User can measure the duration
2860  of an external signal in this mode. Once the Gate mode is enabled, Timer
2861  will start on the raising edge of the external signal. It will keep counting
2862  until the next falling edge.
2863  Precondition:
2864  The DRV_TMR_Initialize function must have been called.
2865  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2866  Parameters:
2867  handle - A valid open-instance handle, returned from the driver's
2868  open routine
2869  Returns:
2870  - true - if the operation is successful
2871  - false - either the handle is invalid or the gate mode
2872  is not supported
2873  Example:
2874  <code>
2875  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2876  DRV_TMR_GateModeClear ( tmrHandle );
2877  </code>
2878  Remarks:
2879  None.
2880 */
2881 
2882 bool
2884  DRV_HANDLE handle ) ;
2885 // *****************************************************************************
2886 /* Function:
2887  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
2888  Summary:
2889  Provides the Timer input frequency.
2890  <p><b>Implementation:</b> Dynamic</p>
2891  Description:
2892  This function provides the Timer input frequency. Input frequency is the
2893  clock to the Timer register and it is considering the prescaler divisor.
2894  Precondition:
2895  The DRV_TMR_Initialize function must have been called.
2896  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2897  Parameters:
2898  handle - A valid open-instance handle, returned from the driver's
2899  open routine
2900  Returns:
2901  32-bit value corresponding to the running frequency.
2902  If Timer clock source is external, then this function returns 0.
2903  Example:
2904  <code>
2905  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2906  uint32_t clkFreqHz;
2907  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2908  </code>
2909  Remarks:
2910  On most processors, the Timer's base frequency is the same as the peripheral
2911  bus clock.
2912 */
2913 
2914 uint32_t
2916  DRV_HANDLE handle ) ;
2917 // *****************************************************************************
2918 /* Function:
2919  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
2920  (
2921  DRV_HANDLE handle,
2922  DRV_TMR_DIVIDER_RANGE* pDivRange
2923  )
2924  Summary:
2925  Returns the Timer divider values.
2926  <p><b>Implementation:</b> Dynamic</p>
2927  Description:
2928  This function provides the Timer operating mode and divider range.
2929  Precondition:
2930  The DRV_TMR_Initialize function must have been called.
2931  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2932  Parameters:
2933  handle - A valid open-instance handle, returned from the driver's
2934  open routine
2935  pDivRange - Address to store the timer divider range.
2936  Returns:
2937  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
2938  The pDivRange is updated with the supported range values.
2939  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
2940  Example:
2941  <code>
2942  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2943  DRV_TMR_OPERATION_MODE timerMode;
2944  DRV_TMR_DIVIDER_RANGE timerRange;
2945  DRV_TMR_DividerRangeGet(handle, &timerRange);
2946  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2947  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
2948  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
2949  </code>
2950  Remarks:
2951  None.
2952 */
2953 
2956  DRV_HANDLE handle ,
2957  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
2958 // *****************************************************************************
2959 // *****************************************************************************
2960 // Section: File includes for the APIs which are required for backward
2961 // compatibility.
2962 // *****************************************************************************
2963 // *****************************************************************************
2964 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
2965 /*******************************************************************************
2966  Timer Device Driver Interface Definition
2967  Company:
2968  Microchip Technology Inc.
2969  File Name:
2970  drv_tmr_compatibility.h
2971  Summary:
2972  Timer device driver interface header file.
2973  Description:
2974  This header file contains macro definition for APIs which will be deprecated
2975  later. This header file is included in drv_tmr.h.
2976 *******************************************************************************/
2977 //DOM-IGNORE-BEGIN
2978 /*******************************************************************************
2979 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2980 Microchip licenses to you the right to use, modify, copy and distribute
2981 Software only when embedded on a Microchip microcontroller or digital signal
2982 controller that is integrated into your product or third party product
2983 (pursuant to the sublicense terms in the accompanying license agreement).
2984 You should refer to the license agreement accompanying this Software for
2985 additional information regarding your rights and obligations.
2986 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2987 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2988 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2989 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2990 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2991 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2992 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2993 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2994 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2995 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2996 *******************************************************************************/
2997 //DOM-IGNORE-END
2998 #ifndef _DRV_TMR_DEPRECATED_H
2999 #define _DRV_TMR_DEPRECATED_H
3000 // *****************************************************************************
3001 // *****************************************************************************
3002 // Section: File includes
3003 // *****************************************************************************
3004 // *****************************************************************************
3005 // *****************************************************************************
3006 /* Function:
3007  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
3008  Summary:
3009  Maintains the driver's state machine, processes the events and implements
3010  its ISR.
3011  <p><b>Implementation:</b> Dynamic</p>
3012  Description:
3013  This function is used to maintain the driver's internal state machine and
3014  processes the timer events in interrupt-driven implementations
3015  (DRV_TMR_INTERRUPT_MODE == true).
3016  Precondition:
3017  The DRV_TMR_Initialize function must have been called for the specified Timer
3018  driver instance.
3019  Parameters:
3020  object - Object handle for the specified driver instance (returned from
3021  DRV_TMR_Initialize)
3022  Returns:
3023  None
3024  Example:
3025  <code>
3026  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
3027  {
3028  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
3029  }
3030  </code>
3031  Remarks:
3032  This function is normally not called directly by an application.
3033  It is called by the timer driver raw ISR.
3034  This function will execute in an ISR context and will never block or access any
3035  resources that may cause it to block.
3036 
3037  This function will be deprecated later, so avoid using it as much as possible.
3038  Use generic function "DRV_TMR_Tasks" instead of this.
3039 */
3040 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
3041 // *****************************************************************************
3042 /* Function:
3043  void DRV_TMR_CounterValue16BitSet
3044  (
3045  DRV_HANDLE handle,
3046  uint16_t counterPeriod
3047  )
3048  Summary:
3049  Updates the 16-bit Timer's counter register.
3050  <p><b>Implementation:</b> Dynamic</p>
3051  Description:
3052  This function updates the 16-bit Timer's value in the counter register. This
3053  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
3054  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
3055  DRV_TMR_CounterValue32BitSet function.
3056  Precondition:
3057  The DRV_TMR_Initialize function must have been called. Must have selected
3058  16-Bit timer mode if mode selection is applicable.
3059  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3060  Parameters:
3061  handle - A valid open-instance handle, returned from the driver's
3062  open routine
3063  counterPeriod - 16-bit counter period value
3064  Returns:
3065  None.
3066  Example:
3067  <code>
3068  //Example to use timer for precision time measurement
3069  //without configuring an alarm (interrupt based)
3070  char appState = 0;
3071  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3072 
3073  switch ( appState )
3074  {
3075  case 0:
3076  //Calculate and set the counter period
3077  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3078 
3079  //counter starts
3080  DRV_TMR_Start ( tmrHandle );
3081 
3082  //Trigger an application operation
3083  app_trigger_operation();
3084 
3085  //Check for time-out in the next state
3086  appState++;
3087  case 1:
3088  //Overflows and stops at 0 if no alarm is set
3089  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3090  {
3091  //Time-out
3092  return false;
3093  }
3094  else if ( app_operation_isComplete( ) )
3095  {
3096  //Operation is complete before time-out
3097  return true;
3098  }
3099  </code>
3100  Remarks:
3101  This function will be deprecated later, so avoid using it as much as possible.
3102  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3103 */
3104 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3105 // *****************************************************************************
3106 /* Function:
3107  void DRV_TMR_CounterValue32BitSet
3108  (
3109  DRV_HANDLE handle,
3110  uint32_t counterPeriod
3111  )
3112  Summary:
3113  Updates the 32-bit Timer's counter register.
3114  <p><b>Implementation:</b> Dynamic</p>
3115  Description:
3116  This function updates the 32-bit Timer's value in the counter register. This
3117  is valid only if the 32-bit mode of the timer is selected Otherwise use
3118  DRV_TMR_CounterValue16BitSet function.
3119  Precondition:
3120  The DRV_TMR_Initialize function must have been called. Must have selected
3121  32-Bit timer mode.
3122  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3123  Parameters:
3124  handle - A valid open-instance handle, returned from the driver's
3125  open routine
3126  counterPeriod - 32-bit counter period value
3127  Returns:
3128  None.
3129  Example:
3130  <code>
3131  //Example to use timer for precision time measurement
3132  //without configuring an alarm (interrupt based)
3133  char appState = 0;
3134  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3135 
3136  switch ( appState )
3137  {
3138  case 0:
3139  //Calculate and set the counter period
3140  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3141 
3142  //counter starts
3143  DRV_TMR_Start ( tmrHandle );
3144 
3145  //Trigger an application operation against which we want to use the time-out
3146  app_trigger_operation();
3147 
3148  //Check for time-out in the next state
3149  appState++;
3150  case 1:
3151  //Overflows and stops at 0 if no alarm is set
3152  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3153  {
3154  //Time-out
3155  return false;
3156  }
3157  else if ( app_operation_isComplete( ) )
3158  {
3159  //Operation is complete before time-out
3160  return true;
3161  }
3162  </code>
3163  Remarks:
3164  In most of the devices only even numbered instances of timer supports
3165  32-bit mode.
3166  This function will be deprecated later, so avoid using it as much as possible.
3167  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3168 */
3169 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3170 // *****************************************************************************
3171 /* Function:
3172  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3173  Summary:
3174  Reads the 16-bit Timer's counter register.
3175  <p><b>Implementation:</b> Dynamic</p>
3176  Description:
3177  This function returns the 16-bit Timer's value in the counter register. This
3178  is valid only if the 16-bit mode of the timer is selected.
3179  Otherwise use DRV_TMR_CounterValue32BitGet function.
3180  Precondition:
3181  The DRV_TMR_Initialize function must have been called. Must have selected
3182  16-Bit timer mode if mode selection is applicable.
3183  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3184  Parameters:
3185  handle - A valid open-instance handle, returned from the driver's
3186  open routine
3187 
3188  Returns:
3189  Timer period in 16-bit mode.
3190  Example:
3191  <code>
3192  //Example to use timer for precision time measurement
3193  //without configuring an alarm (interrupt based)
3194  char appState = 0;
3195  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3196 
3197  switch ( appState )
3198  {
3199  case 0:
3200  //Calculate and set the counter period
3201  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3202 
3203  //counter starts
3204  DRV_TMR_Start ( tmrHandle );
3205 
3206  //Trigger an application operation
3207  app_trigger_operation();
3208 
3209  //Check for time-out in the next state
3210  appState++;
3211  case 1:
3212  //Overflows and stops at 0 if no alarm is set
3213  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3214  {
3215  //Time-out
3216  return false;
3217  }
3218  else if ( app_operation_isComplete( ) )
3219  {
3220  //Operation is complete before time-out
3221  return true;
3222  }
3223  </code>
3224  Remarks:
3225  This function will be deprecated later, so avoid using it as much as possible.
3226  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3227 */
3228 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3229 // *****************************************************************************
3230 /* Function:
3231  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3232  Summary:
3233  Reads the 32-bit Timer's counter register.
3234  <p><b>Implementation:</b> Dynamic</p>
3235  Description:
3236  This function returns the 32-bit Timer's value in the counter register. This
3237  is valid only if the 32-bit mode of the timer is selected Otherwise use
3238  DRV_TMR_CounterValue16BitGet function.
3239  Precondition:
3240  The DRV_TMR_Initialize function must have been called. Must have selected
3241  32-Bit timer mode.
3242  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3243  Parameters:
3244  handle - A valid open-instance handle, returned from the driver's
3245  open routine
3246 
3247  Returns:
3248  32-Bit Counter value.
3249  Example:
3250  <code>
3251  //Example to use timer for precision time measurement
3252  //without configuring an alarm (interrupt based)
3253  char appState = 0;
3254  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3255 
3256  switch ( appState )
3257  {
3258  case 0:
3259  //Calculate and set the counter period
3260  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3261 
3262  //counter starts
3263  DRV_TMR_Start ( tmrHandle );
3264 
3265  //Trigger an application operation
3266  app_trigger_operation();
3267 
3268  //Check for time-out in the next state
3269  appState++;
3270  case 1:
3271  //Overflows and stops at 0 if no alarm is set
3272  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3273  {
3274  //Time-out
3275  return false;
3276  }
3277  else if ( app_operation_isComplete( ) )
3278  {
3279  //Operation is complete before time-out
3280  return true;
3281  }
3282  </code>
3283  Remarks:
3284  In most of the devices only even numbered instances of timer supports
3285  32-bit mode.
3286  This function will be deprecated later, so avoid using it as much as possible.
3287  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3288 */
3289 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3290 // *****************************************************************************
3291 /* Function:
3292  void DRV_TMR_Alarm16BitRegister
3293  (
3294  DRV_HANDLE handle,
3295  uint16_t period,
3296  bool isPeriodic,
3297  uintptr_t context,
3298  DRV_TMR_CALLBACK callBack
3299  )
3300  Summary:
3301  Sets up an alarm.
3302  <p><b>Implementation:</b> Dynamic</p>
3303  Description:
3304  This function sets up an alarm, allowing the client to receive a callback
3305  from the driver when the counter period elapses. Alarms can be one-shot or
3306  periodic. This API is valid only if the 16-bit mode of the timer is
3307  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3308  Precondition:
3309  The DRV_TMR_Initialize function must have been called. Must have selected
3310  16-Bit timer mode if mode selection is applicable.
3311  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3312  Parameters:
3313  handle - A valid handle, returned from DRV_TMR_Open
3314  period - 16-bit period which will be loaded into the Timer hardware register.
3315 
3316  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3317 
3318  context - A reference, call back function will be called with the same
3319  reference.
3320 
3321  callBack - A call back function which will be called on period elapse.
3322 
3323  Returns:
3324  None
3325  Example:
3326  <code>
3327  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3328 
3329  void setupTask ()
3330  {
3331  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3332 
3333  // Calculate the count to be passed on from the clock input
3334  //Periodically toggle LED
3335  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3336  ToggleLedCallBack );
3337  }
3338 
3339  void ToggleLedCallBack ( uintptr_t context )
3340  {
3341  //Toggle
3342  }
3343  </code>
3344  Remarks:
3345  This function will be deprecated later, so avoid using it as much as possible.
3346  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3347 */
3348 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3349 // *****************************************************************************
3350 /* Function:
3351  void DRV_TMR_Alarm32BitRegister
3352  (
3353  DRV_HANDLE handle,
3354  uint32_t period,
3355  bool isPeriodic,
3356  uintptr_t context,
3357  DRV_TMR_CALLBACK callBack
3358  )
3359  Summary:
3360  Sets up an alarm.
3361  <p><b>Implementation:</b> Dynamic</p>
3362  Description:
3363  This function sets up an alarm, allowing the client to receive a callback
3364  from the driver when the counter period elapses. Alarms can be one-shot or
3365  periodic. This API is valid only if the 32-bit mode of the timer is
3366  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3367  Precondition:
3368  The DRV_TMR_Initialize function must have been called. Must have selected
3369  32-Bit timer mode.
3370  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3371  Parameters:
3372  handle - A valid handle, returned from DRV_TMR_Open
3373  period - 32-bit period which will be loaded into the Timer hardware register.
3374 
3375  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3376 
3377  context - A reference, call back function will be called with the same
3378  reference.
3379 
3380  callBack - A call back function which will be called on period elapse.
3381 
3382  Returns:
3383  None
3384  Example:
3385  <code>
3386  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3387 
3388  void setupTask ()
3389  {
3390  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3391 
3392  // Calculate the count to be passed on from the clock input
3393  //Periodically toggle LED
3394  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3395  ToggleLedCallBack );
3396  }
3397 
3398  void ToggleLedCallBack ( uintptr_t context )
3399  {
3400  //Toggle
3401  }
3402  </code>
3403  Remarks:
3404  In most of the devices only even numbered instances of timer supports
3405  32-bit mode.
3406  This function will be deprecated later, so avoid using it as much as possible.
3407  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3408 */
3409 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3410 // *****************************************************************************
3411 /* Function:
3412  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3413  Summary:
3414  Updates the 16-bit Timer's period.
3415  <p><b>Implementation:</b> Dynamic</p>
3416  Description:
3417  This function updates the 16-bit Timer's period. This API is valid only if
3418  the 16-bit mode of the timer is selected
3419  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3420  Precondition:
3421  The DRV_TMR_Initialize function must have been called. Must have selected
3422  16-Bit timer mode if mode selection is applicable.
3423  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3424  Parameters:
3425  handle - A valid open-instance handle, returned from the driver's
3426  open routine
3427  value - 16-bit Period value
3428  Returns:
3429  None.
3430  Example:
3431  <code>
3432  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3433  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3434  </code>
3435  Remarks:
3436  This function will be deprecated later, so avoid using it as much as possible.
3437  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3438 */
3439 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3440 // *****************************************************************************
3441 /* Function:
3442  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3443  Summary:
3444  Updates the 32-bit Timer's period.
3445  <p><b>Implementation:</b> Dynamic</p>
3446  Description:
3447  This function updates the 32-bit Timer's period. This API is valid only if
3448  the 32-bit mode of the timer is selected
3449  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3450  Precondition:
3451  The DRV_TMR_Initialize unction must have been called. Must have selected
3452  32-Bit timer mode.
3453  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3454  Parameters:
3455  handle - A valid open-instance handle, returned from the driver's
3456  open routine
3457  period - 32-bit Period value
3458  Returns:
3459  None.
3460  Example:
3461  <code>
3462  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3463  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3464  </code>
3465  Remarks:
3466  In most of the devices only even numbered instances of timer supports
3467  32-bit mode.
3468  This function will be deprecated later, so avoid using it as much as possible.
3469  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3470 */
3471 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3472 // *****************************************************************************
3473 /* Function:
3474  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3475  Summary:
3476  Provides the 16-bit Timer's period.
3477  <p><b>Implementation:</b> Dynamic</p>
3478  Description:
3479  This function gets the 16-bit Timer's period. This API is valid only if
3480  the 16-bit mode of the timer is selected.
3481  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3482  Precondition:
3483  The DRV_TMR_Initialize function must have been called. Must have selected
3484  16-Bit timer mode if mode selection is applicable.
3485  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3486  Parameters:
3487  handle - A valid open-instance handle, returned from the driver's
3488  open routine
3489  Returns:
3490  16-bit timer period value
3491  Example:
3492  <code>
3493  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3494  uint16_t period;
3495 
3496  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3497  </code>
3498  Remarks:
3499  This function will be deprecated later, so avoid using it as much as possible.
3500  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3501 */
3502 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3503 // *****************************************************************************
3504 /* Function:
3505  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3506  Summary:
3507  Provides the 32-bit Timer's period.
3508  <p><b>Implementation:</b> Dynamic</p>
3509  Description:
3510  This function gets the 32-bit Timer's period. This API is valid only if
3511  the 32-bit mode of the timer is selected
3512  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3513  Precondition:
3514  The DRV_TMR_Initialize function must have been called. Must have selected
3515  32-Bit timer mode.
3516  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3517  Parameters:
3518  handle - A valid open-instance handle, returned from the driver's
3519  open routine
3520  Returns:
3521  32-bit Timer period value.
3522  Example:
3523  <code>
3524  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3525  uint32_t period;
3526  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3527  </code>
3528  Remarks:
3529  In most of the devices only even numbered instances of timer supports
3530  32-bit mode.
3531  This function will be deprecated later, so avoid using it as much as possible.
3532  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3533 */
3534 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3535 // *****************************************************************************
3536 /* Function:
3537  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3538  Summary:
3539  Removes a previously set alarm.
3540  <p><b>Implementation:</b> Dynamic</p>
3541  Description:
3542  This function removes a previously set alarm. This API is valid only if
3543  the 16-bit mode of the timer is selected
3544  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3545  Precondition:
3546  The DRV_TMR_Initialize function must have been called. Must have selected
3547  16-Bit timer mode if mode selection is applicable.
3548  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3549 
3550  DRV_TMR_Alarm16BitRegister function must have been called before.
3551  Parameters:
3552  handle - A valid open-instance handle, returned from the driver's
3553  open routine
3554  Returns:
3555  None.
3556  Example:
3557  <code>
3558  //Example of a key debounce check
3559 
3560  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3561  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3562  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3563 
3564  void keyPressDetect ()
3565  {
3566  // Calculate the count to be passed on from the clock input
3567  //Periodically toggle LED
3568  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3569  DebounceCheck );
3570  }
3571 
3572  void DebounceCheck ( uintptr_t context )
3573  {
3574  readKey = AppReadKey();
3575 
3576  if ( readKey != lastReadKey )
3577  {
3578  lastReadKey = readKey;
3579  keyCount = 0;
3580  }
3581  else
3582  {
3583  if ( keyCount > 20 )
3584  {
3585  globalKeyState = readKey;
3586  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3587  }
3588  keyCount++;
3589  }
3590  }
3591  </code>
3592  Remarks:
3593  This function will be deprecated later, so avoid using it as much as possible.
3594  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3595 */
3596 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3597 // *****************************************************************************
3598 /* Function:
3599  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3600  Summary:
3601  Removes a previously set alarm.
3602  <p><b>Implementation:</b> Dynamic</p>
3603  Description:
3604  This function removes a previously set alarm. This API is valid only if
3605  the 32-bit mode of the timer is selected
3606  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3607  Precondition:
3608  The DRV_TMR_Initialize function must have been called. Must have selected
3609  32-Bit timer mode if mode selection is applicable.
3610  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3611 
3612  DRV_TMR_Alarm32BitRegister function must have been called before.
3613  Parameters:
3614  handle - A valid open-instance handle, returned from the driver's
3615  open routine
3616  Returns:
3617  None.
3618  Example:
3619  <code>
3620  //Example of a key debounce check
3621 
3622  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3623  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3624  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3625 
3626  void keyPressDetect ( void )
3627  {
3628  // Calculate the count to be passed on from the clock input
3629  //Periodically check the key status
3630  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
3631  DebounceCheck );
3632  }
3633 
3634  void DebounceCheck ( uintptr_t context )
3635  {
3636  readKey = AppReadKey();
3637 
3638  if ( readKey != lastReadKey )
3639  {
3640  lastReadKey = readKey;
3641  keyCount = 0;
3642  }
3643  else
3644  {
3645  if ( keyCount > 20 )
3646  {
3647  //Key is stable now
3648  globalKeyState = readKey;
3649  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
3650  }
3651  keyCount++;
3652  }
3653  }
3654  </code>
3655  Remarks:
3656  In most of the devices only even numbered instances of timer supports
3657  32-bit mode.
3658  This function will be deprecated later, so avoid using it as much as possible.
3659  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3660 */
3661 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3662  // #ifndef _DRV_TMR_DEPRECATED_H
3663 /*******************************************************************************
3664  End of File
3665 */
3666 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
3667 /* CLOSE_FILE Include File */
3668 
3669 //DOM-IGNORE-BEGIN
3670 //DOM-IGNORE-END
3671  // #ifndef _DRV_TMR_H
3672 /*******************************************************************************
3673  End of File
3674 */
3675 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
3676 /* CLOSE_FILE Include File */
3677 
3678 #include "peripheral/tmr/plib_tmr.h"
3679 #include "peripheral/int/plib_int.h"
3680 // maximum divider value for 32 bit operation mode
3681 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
3682 // minimum divider value for 32 bit operation mode
3683 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
3684 // maximum divider value for 16 bit operation mode
3685 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
3686 // minimum divider value for 16 bit operation mode
3687 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
3688 // *****************************************************************************
3689 // *****************************************************************************
3690 // Section: Interface Headers for Instance 0 for the static driver
3691 // *****************************************************************************
3692 // *****************************************************************************
3693 
3694 void
3695  DRV_TMR0_Initialize ( void ) ;
3696 
3697 bool
3698  DRV_TMR0_Start ( void ) ;
3699 
3700 void
3701  DRV_TMR0_Stop ( void ) ;
3702 
3703 static inline void
3705  {
3706  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
3707  DRV_TMR0_Stop () ;
3708  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
3709  adc_63zqendz ( 2 ) ; /* 30 */
3710  }
3711 
3712 static inline SYS_STATUS
3714 {
3715  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
3716  /* Return the status as ready always */
3717  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
3718  adc_63zqendz ( 4 ) ; /* 30 */
3719  return
3720  SYS_STATUS_READY ;
3721 }
3722 
3723 static inline void
3724  DRV_TMR0_Open ( void )
3725  {
3726  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
3727  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
3728  adc_63zqendz ( 6 ) ; /* 30 */
3729  }
3730 
3732  DRV_TMR0_ClientStatus ( void ) ;
3733 
3734 static inline DRV_TMR_OPERATION_MODE
3736 {
3737  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
3738  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
3739  adc_63zqendz ( 8 ) ; /* 30 */
3740  return
3742 }
3743 
3744 static inline void
3746  {
3747  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
3748  DRV_TMR0_Stop () ;
3749  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
3750  adc_63zqendz ( 10 ) ; /* 30 */
3751  }
3752 
3753 bool
3755  DRV_TMR_CLK_SOURCES clockSource ,
3756  TMR_PRESCALE prescale ) ;
3757 
3758 void
3760  uint32_t value ) ;
3761 
3762 uint32_t
3763  DRV_TMR0_CounterValueGet ( void ) ;
3764 
3765 void
3766  DRV_TMR0_CounterClear ( void ) ;
3767 
3768 TMR_PRESCALE
3769  DRV_TMR0_PrescalerGet ( void ) ;
3770 
3771 void
3773  uint32_t value ) ;
3774 
3775 uint32_t
3776  DRV_TMR0_PeriodValueGet ( void ) ;
3777 
3778 void
3779  DRV_TMR0_StopInIdleDisable ( void ) ;
3780 
3781 void
3782  DRV_TMR0_StopInIdleEnable ( void ) ;
3783 
3784 static inline void
3786  {
3787  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
3788  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
3789  adc_63zqendz ( 12 ) ; /* 30 */
3790  }
3791 
3792 uint32_t
3793  DRV_TMR0_CounterFrequencyGet ( void ) ;
3794 
3797  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3798 // *****************************************************************************
3799 // *****************************************************************************
3800 // Section: Interface Headers for Instance 1 for the static driver
3801 // *****************************************************************************
3802 // *****************************************************************************
3803 
3804 void
3805  DRV_TMR1_Initialize ( void ) ;
3806 
3807 bool
3808  DRV_TMR1_Start ( void ) ;
3809 
3810 void
3811  DRV_TMR1_Stop ( void ) ;
3812 
3813 static inline void
3815  {
3816  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
3817  DRV_TMR1_Stop () ;
3818  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
3819  adc_63zqendz ( 14 ) ; /* 30 */
3820  }
3821 
3822 static inline SYS_STATUS
3824 {
3825  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
3826  /* Return the status as ready always */
3827  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
3828  adc_63zqendz ( 16 ) ; /* 30 */
3829  return
3830  SYS_STATUS_READY ;
3831 }
3832 
3833 static inline void
3834  DRV_TMR1_Open ( void )
3835  {
3836  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
3837  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
3838  adc_63zqendz ( 18 ) ; /* 30 */
3839  }
3840 
3842  DRV_TMR1_ClientStatus ( void ) ;
3843 
3844 static inline DRV_TMR_OPERATION_MODE
3846 {
3847  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
3848  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
3849  adc_63zqendz ( 20 ) ; /* 30 */
3850  return
3852 }
3853 
3854 static inline void
3856  {
3857  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
3858  DRV_TMR1_Stop () ;
3859  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
3860  adc_63zqendz ( 22 ) ; /* 30 */
3861  }
3862 
3863 bool
3865  DRV_TMR_CLK_SOURCES clockSource ,
3866  TMR_PRESCALE prescale ) ;
3867 
3868 void
3870  uint32_t value ) ;
3871 
3872 uint32_t
3873  DRV_TMR1_CounterValueGet ( void ) ;
3874 
3875 void
3876  DRV_TMR1_CounterClear ( void ) ;
3877 
3878 TMR_PRESCALE
3879  DRV_TMR1_PrescalerGet ( void ) ;
3880 
3881 void
3883  uint32_t value ) ;
3884 
3885 uint32_t
3886  DRV_TMR1_PeriodValueGet ( void ) ;
3887 
3888 void
3889  DRV_TMR1_StopInIdleDisable ( void ) ;
3890 
3891 void
3892  DRV_TMR1_StopInIdleEnable ( void ) ;
3893 
3894 static inline void
3896  {
3897  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
3898  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
3899  adc_63zqendz ( 24 ) ; /* 30 */
3900  }
3901 
3902 uint32_t
3903  DRV_TMR1_CounterFrequencyGet ( void ) ;
3904 
3907  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3908 // *****************************************************************************
3909 // *****************************************************************************
3910 // Section: Interface Headers for Instance 2 for the static driver
3911 // *****************************************************************************
3912 // *****************************************************************************
3913 
3914 void
3915  DRV_TMR2_Initialize ( void ) ;
3916 
3917 bool
3918  DRV_TMR2_Start ( void ) ;
3919 
3920 void
3921  DRV_TMR2_Stop ( void ) ;
3922 
3923 static inline void
3925  {
3926  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
3927  DRV_TMR2_Stop () ;
3928  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
3929  adc_63zqendz ( 26 ) ; /* 30 */
3930  }
3931 
3932 static inline SYS_STATUS
3934 {
3935  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
3936  /* Return the status as ready always */
3937  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
3938  adc_63zqendz ( 28 ) ; /* 30 */
3939  return
3940  SYS_STATUS_READY ;
3941 }
3942 
3943 static inline void
3944  DRV_TMR2_Open ( void )
3945  {
3946  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
3947  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
3948  adc_63zqendz ( 30 ) ; /* 30 */
3949  }
3950 
3952  DRV_TMR2_ClientStatus ( void ) ;
3953 
3954 static inline DRV_TMR_OPERATION_MODE
3956 {
3957  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
3958  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
3959  adc_63zqendz ( 32 ) ; /* 30 */
3960  return
3962 }
3963 
3964 static inline void
3966  {
3967  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
3968  DRV_TMR2_Stop () ;
3969  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
3970  adc_63zqendz ( 34 ) ; /* 30 */
3971  }
3972 
3973 bool
3975  DRV_TMR_CLK_SOURCES clockSource ,
3976  TMR_PRESCALE prescale ) ;
3977 
3978 void
3980  uint32_t value ) ;
3981 
3982 uint32_t
3983  DRV_TMR2_CounterValueGet ( void ) ;
3984 
3985 void
3986  DRV_TMR2_CounterClear ( void ) ;
3987 
3988 TMR_PRESCALE
3989  DRV_TMR2_PrescalerGet ( void ) ;
3990 
3991 void
3993  uint32_t value ) ;
3994 
3995 uint32_t
3996  DRV_TMR2_PeriodValueGet ( void ) ;
3997 
3998 void
3999  DRV_TMR2_StopInIdleDisable ( void ) ;
4000 
4001 void
4002  DRV_TMR2_StopInIdleEnable ( void ) ;
4003 
4004 static inline void
4006  {
4007  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
4008  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
4009  adc_63zqendz ( 36 ) ; /* 30 */
4010  }
4011 
4012 uint32_t
4013  DRV_TMR2_CounterFrequencyGet ( void ) ;
4014 
4017  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4018 // *****************************************************************************
4019 // *****************************************************************************
4020 // Section: Interface Headers for Instance 3 for the static driver
4021 // *****************************************************************************
4022 // *****************************************************************************
4023 
4024 void
4025  DRV_TMR3_Initialize ( void ) ;
4026 
4027 bool
4028  DRV_TMR3_Start ( void ) ;
4029 
4030 void
4031  DRV_TMR3_Stop ( void ) ;
4032 
4033 static inline void
4035  {
4036  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
4037  DRV_TMR3_Stop () ;
4038  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
4039  adc_63zqendz ( 38 ) ; /* 30 */
4040  }
4041 
4042 static inline SYS_STATUS
4044 {
4045  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
4046  /* Return the status as ready always */
4047  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
4048  adc_63zqendz ( 40 ) ; /* 30 */
4049  return
4050  SYS_STATUS_READY ;
4051 }
4052 
4053 static inline void
4054  DRV_TMR3_Open ( void )
4055  {
4056  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
4057  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
4058  adc_63zqendz ( 42 ) ; /* 30 */
4059  }
4060 
4062  DRV_TMR3_ClientStatus ( void ) ;
4063 
4064 static inline DRV_TMR_OPERATION_MODE
4066 {
4067  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
4068  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
4069  adc_63zqendz ( 44 ) ; /* 30 */
4070  return
4072 }
4073 
4074 static inline void
4076  {
4077  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
4078  DRV_TMR3_Stop () ;
4079  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
4080  adc_63zqendz ( 46 ) ; /* 30 */
4081  }
4082 
4083 bool
4085  DRV_TMR_CLK_SOURCES clockSource ,
4086  TMR_PRESCALE prescale ) ;
4087 
4088 void
4090  uint32_t value ) ;
4091 
4092 uint32_t
4093  DRV_TMR3_CounterValueGet ( void ) ;
4094 
4095 void
4096  DRV_TMR3_CounterClear ( void ) ;
4097 
4098 TMR_PRESCALE
4099  DRV_TMR3_PrescalerGet ( void ) ;
4100 
4101 void
4103  uint32_t value ) ;
4104 
4105 uint32_t
4106  DRV_TMR3_PeriodValueGet ( void ) ;
4107 
4108 void
4109  DRV_TMR3_StopInIdleDisable ( void ) ;
4110 
4111 void
4112  DRV_TMR3_StopInIdleEnable ( void ) ;
4113 
4114 static inline void
4116  {
4117  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4118  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4119  adc_63zqendz ( 48 ) ; /* 30 */
4120  }
4121 
4122 uint32_t
4123  DRV_TMR3_CounterFrequencyGet ( void ) ;
4124 
4127  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4128 // *****************************************************************************
4129 // *****************************************************************************
4130 // Section: Interface Headers for Instance 4 for the static driver
4131 // *****************************************************************************
4132 // *****************************************************************************
4133 
4134 void
4135  DRV_TMR4_Initialize ( void ) ;
4136 
4137 bool
4138  DRV_TMR4_Start ( void ) ;
4139 
4140 void
4141  DRV_TMR4_Stop ( void ) ;
4142 
4143 static inline void
4145  {
4146  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4147  DRV_TMR4_Stop () ;
4148  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4149  adc_63zqendz ( 50 ) ; /* 30 */
4150  }
4151 
4152 static inline SYS_STATUS
4154 {
4155  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4156  /* Return the status as ready always */
4157  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4158  adc_63zqendz ( 52 ) ; /* 30 */
4159  return
4160  SYS_STATUS_READY ;
4161 }
4162 
4163 static inline void
4164  DRV_TMR4_Open ( void )
4165  {
4166  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4167  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4168  adc_63zqendz ( 54 ) ; /* 30 */
4169  }
4170 
4172  DRV_TMR4_ClientStatus ( void ) ;
4173 
4174 static inline DRV_TMR_OPERATION_MODE
4176 {
4177  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4178  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4179  adc_63zqendz ( 56 ) ; /* 30 */
4180  return
4182 }
4183 
4184 static inline void
4186  {
4187  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4188  DRV_TMR4_Stop () ;
4189  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4190  adc_63zqendz ( 58 ) ; /* 30 */
4191  }
4192 
4193 bool
4195  DRV_TMR_CLK_SOURCES clockSource ,
4196  TMR_PRESCALE prescale ) ;
4197 
4198 void
4200  uint32_t value ) ;
4201 
4202 uint32_t
4203  DRV_TMR4_CounterValueGet ( void ) ;
4204 
4205 void
4206  DRV_TMR4_CounterClear ( void ) ;
4207 
4208 TMR_PRESCALE
4209  DRV_TMR4_PrescalerGet ( void ) ;
4210 
4211 void
4213  uint32_t value ) ;
4214 
4215 uint32_t
4216  DRV_TMR4_PeriodValueGet ( void ) ;
4217 
4218 void
4219  DRV_TMR4_StopInIdleDisable ( void ) ;
4220 
4221 void
4222  DRV_TMR4_StopInIdleEnable ( void ) ;
4223 
4224 static inline void
4226  {
4227  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4228  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4229  adc_63zqendz ( 60 ) ; /* 30 */
4230  }
4231 
4232 uint32_t
4233  DRV_TMR4_CounterFrequencyGet ( void ) ;
4234 
4237  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4238  // #ifndef _DRV_TMR_STATIC_H
4239 /*******************************************************************************
4240  End of File
4241 */
4242 
4243 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4244 /* CLOSE_FILE Include File */
4245 
4246 #include "peripheral/int/plib_int.h"
4247 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4248 /*******************************************************************************
4249  PMP Driver Interface Declarations for Static Single Instance Driver
4250  Company:
4251  Microchip Technology Inc.
4252  File Name:
4253  drv_pmp_static.h
4254  Summary:
4255  PMP driver interface declarations for the static single instance driver.
4256  Description:
4257  The PMP device driver provides a simple interface to manage the PMP
4258  modules on Microchip microcontrollers. This file defines the interface
4259  Declarations for the PMP driver.
4260 
4261  Remarks:
4262  Static interfaces incorporate the driver instance number within the names
4263  of the routines, eliminating the need for an object ID or object handle.
4264 
4265  Static single-open interfaces also eliminate the need for the open handle.
4266 *******************************************************************************/
4267 //DOM-IGNORE-BEGIN
4268 /*******************************************************************************
4269 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4270 Microchip licenses to you the right to use, modify, copy and distribute
4271 Software only when embedded on a Microchip microcontroller or digital signal
4272 controller that is integrated into your product or third party product
4273 (pursuant to the sublicense terms in the accompanying license agreement).
4274 You should refer to the license agreement accompanying this Software for
4275 additional information regarding your rights and obligations.
4276 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4277 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4278 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4279 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4280 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4281 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4282 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4283 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4284 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4285 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4286 *******************************************************************************/
4287 //DOM-IGNORE-END
4288 #ifndef _DRV_PMP_STATIC_H
4289 #define _DRV_PMP_STATIC_H
4290 #include "peripheral/pmp/plib_pmp.h"
4291 // *****************************************************************************
4292 // *****************************************************************************
4293 // Section: Interface Headers for Instance 0 for the static driver
4294 // *****************************************************************************
4295 // *****************************************************************************
4296 
4297 void
4298  DRV_PMP0_Initialize ( void ) ;
4299 
4300 void
4301  DRV_PMP0_ModeConfig ( void ) ;
4302 
4303 void
4305  PMP_DATA_WAIT_STATES dataWait ,
4306  PMP_STROBE_WAIT_STATES strobeWait ,
4307  PMP_DATA_HOLD_STATES dataHold ) ;
4308 
4309 uint8_t
4310  DRV_PMP0_Read ( void ) ;
4311 
4312 void
4313  DRV_PMP0_Write (
4314  uint8_t data ) ;
4315  // #ifndef _DRV_PMP_STATIC_H
4316 /*******************************************************************************
4317  End of File
4318 */
4319 
4320 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4321 /* CLOSE_FILE Include File */
4322 
4323 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4324 /*******************************************************************************
4325  USART Driver Interface Declarations for Static Single Instance Driver
4326  Company:
4327  Microchip Technology Inc.
4328  File Name:
4329  drv_usart_static.h
4330  Summary:
4331  USART driver interface declarations for the static single instance driver.
4332  Description:
4333  The USART device driver provides a simple interface to manage the USART
4334  modules on Microchip microcontrollers. This file defines the interface
4335  Declarations for the USART static driver.
4336  Remarks:
4337  Static interfaces incorporate the driver instance number within the names
4338  of the routines, eliminating the need for an object ID or object handle.
4339  Static single-open interfaces also eliminate the need for the open handle.
4340 *******************************************************************************/
4341 //DOM-IGNORE-BEGIN
4342 /*******************************************************************************
4343 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4344 Microchip licenses to you the right to use, modify, copy and distribute
4345 Software only when embedded on a Microchip microcontroller or digital signal
4346 controller that is integrated into your product or third party product
4347 (pursuant to the sublicense terms in the accompanying license agreement).
4348 You should refer to the license agreement accompanying this Software for
4349 additional information regarding your rights and obligations.
4350 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4351 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4352 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4353 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4354 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4355 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4356 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4357 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4358 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4359 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4360 *******************************************************************************/
4361 //DOM-IGNORE-END
4362 #ifndef _DRV_USART_STATIC_H
4363 #define _DRV_USART_STATIC_H
4364 // *****************************************************************************
4365 // *****************************************************************************
4366 // Section: Included Files
4367 // *****************************************************************************
4368 // *****************************************************************************
4369 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4370 /*******************************************************************************
4371  USART Driver Local Data Structures for static implementation
4372  Company:
4373  Microchip Technology Inc.
4374  File Name:
4375  drv_usart_static_local.h
4376  Summary:
4377  USART Driver Local Data Structures for static implementation
4378  Description:
4379  Driver Local Data Structures for static implementation
4380 *******************************************************************************/
4381 //DOM-IGNORE-BEGIN
4382 /*******************************************************************************
4383 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4384 Microchip licenses to you the right to use, modify, copy and distribute Software
4385 only when embedded on a Microchip microcontroller or digital signal controller
4386 that is integrated into your product or third party product (pursuant to the
4387 sublicense terms in the accompanying license agreement).
4388 You should refer to the license agreement accompanying this Software for
4389 additional information regarding your rights and obligations.
4390 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4391 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4392 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4393 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4394 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4395 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4396 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4397 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4398 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4399 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4400 *******************************************************************************/
4401 //DOM-IGNORE-END
4402 #ifndef _DRV_USART_STATIC_LOCAL_H
4403 #define _DRV_USART_STATIC_LOCAL_H
4404 // *****************************************************************************
4405 // *****************************************************************************
4406 // Section: Included Files
4407 // *****************************************************************************
4408 // *****************************************************************************
4409 #include <stdint.h>
4410 #include <stdbool.h>
4411 #include <stddef.h>
4412 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4413 /*******************************************************************************
4414  USART Driver Interface Header File
4415  Company:
4416  Microchip Technology Inc.
4417  File Name:
4418  drv_usart.h
4419  Summary:
4420  USART Driver Interface Header File
4421  Description:
4422  The USART device driver provides a simple interface to manage the USART or
4423  UART modules on Microchip microcontrollers. This file provides the
4424  interface definition for the USART driver.
4425 *******************************************************************************/
4426 //DOM-IGNORE-BEGIN
4427 /*******************************************************************************
4428 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4429 Microchip licenses to you the right to use, modify, copy and distribute
4430 Software only when embedded on a Microchip microcontroller or digital signal
4431 controller that is integrated into your product or third party product
4432 (pursuant to the sublicense terms in the accompanying license agreement).
4433 You should refer to the license agreement accompanying this Software for
4434 additional information regarding your rights and obligations.
4435 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4436 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4437 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4438 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4439 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4440 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4441 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4442 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4443 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4444 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4445 *******************************************************************************/
4446 //DOM-IGNORE-END
4447 #ifndef _DRV_USART_H
4448 #define _DRV_USART_H
4449 // *****************************************************************************
4450 // *****************************************************************************
4451 // Section: File includes
4452 // *****************************************************************************
4453 // *****************************************************************************
4454 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4455 /*******************************************************************************
4456  USART Driver Definitions Header File
4457  Company:
4458  Microchip Technology Inc.
4459  File Name:
4460  drv_usart_definitions.h
4461  Summary:
4462  USART Driver Definitions Header File
4463  Description:
4464  This file will provide enumerations and other dependencies needed by
4465  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4466 *******************************************************************************/
4467 //DOM-IGNORE-BEGIN
4468 /*******************************************************************************
4469 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4470 Microchip licenses to you the right to use, modify, copy and distribute
4471 Software only when embedded on a Microchip microcontroller or digital signal
4472 controller that is integrated into your product or third party product
4473 (pursuant to the sublicense terms in the accompanying license agreement).
4474 You should refer to the license agreement accompanying this Software for
4475 additional information regarding your rights and obligations.
4476 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4477 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4478 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4479 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4480 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4481 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4482 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4483 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4484 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4485 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4486 *******************************************************************************/
4487 //DOM-IGNORE-END
4488 #ifndef _DRV_USART_DEFINITIONS_H
4489 #define _DRV_USART_DEFINITIONS_H
4490 // *****************************************************************************
4491 // *****************************************************************************
4492 // Section: File includes
4493 // *****************************************************************************
4494 // *****************************************************************************
4495 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4496 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4497 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4498 /*******************************************************************************
4499  USART Peripheral Library Interface Header
4500  Company:
4501  Microchip Technology Inc.
4502  File Name:
4503  plib_usart.h
4504  Summary:
4505  USART Peripheral Library interface header.
4506  Description:
4507  This header file contains the function prototypes and definitions of
4508  the data types and constants that make up the interface to the USART
4509  Peripheral Library for all families of Microchip microcontrollers. The
4510  functions in this file are common to the USART module.
4511  *******************************************************************************/
4512 // DOM-IGNORE-BEGIN
4513 /*******************************************************************************
4514 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4515 Microchip licenses to you the right to use, modify, copy and distribute
4516 Software only when embedded on a Microchip microcontroller or digital signal
4517 controller that is integrated into your product or third party product
4518 (pursuant to the sublicense terms in the accompanying license agreement).
4519 You should refer to the license agreement accompanying this Software for
4520 additional information regarding your rights and obligations.
4521 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4522 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4523 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4524 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4525 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4526 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4527 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4528 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4529 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4530 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4531  *******************************************************************************/
4532 // DOM-IGNORE-END
4533 #ifndef _PLIB_USART_H
4534 #define _PLIB_USART_H
4535 // DOM-IGNORE-BEGIN
4536 // DOM-IGNORE-END
4537 // ****************************************************************************
4538 // ****************************************************************************
4539 // Section: Included Files
4540 // ****************************************************************************
4541 // ****************************************************************************
4542 /* This section lists the other files that are included in this file.
4543 */
4544 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4545 /*******************************************************************************
4546  Processor Selector File for the USART
4547  Company:
4548  Microchip Technology Incorporated
4549  File Name:
4550  processor.h
4551  Summary:
4552  Selects the appropriate header for the part family
4553  Description:
4554  This file selects the appropriate header for the part family
4555  *******************************************************************************/
4556 // DOM-IGNORE-BEGIN
4557 /*******************************************************************************
4558 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4559 Microchip licenses to you the right to use, modify, copy and distribute
4560 Software only when embedded on a Microchip microcontroller or digital signal
4561 controller that is integrated into your product or third party product
4562 (pursuant to the sublicense terms in the accompanying license agreement).
4563 You should refer to the license agreement accompanying this Software for
4564 additional information regarding your rights and obligations.
4565 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4566 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4567 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4568 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4569 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4570 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4571 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4572 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4573 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4574 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4575  *******************************************************************************/
4576 // DOM-IGNORE-END
4577 #ifndef _USART_PROCESSOR_H
4578 #define _USART_PROCESSOR_H
4579 // *****************************************************************************
4580 // *****************************************************************************
4581 // Section: Included Files
4582 // *****************************************************************************
4583 // *****************************************************************************
4584 /* This section lists the other files that are included in this file.
4585  */
4586 #include <stdint.h>
4587 #include <stdbool.h>
4588 #error "No Processor Family specified"
4589  //
4590  // _USART_PROCESSOR_H
4591 /*******************************************************************************
4592  End of File
4593  */
4594 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4595 /* CLOSE_FILE Include File */
4596 
4597 // ****************************************************************************
4598 // ****************************************************************************
4599 // Section: USART Peripheral Library Interface Functions
4600 // ****************************************************************************
4601 // ****************************************************************************
4602 //******************************************************************************
4603 /* Function:
4604  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4605  Summary:
4606  Enables the USART module to continue to operate when an overflow error
4607  condition has occurred.
4608  Description:
4609  This function enables the USART module to continue to operate when an
4610  overflow error condition has occurred.
4611  This operation is atomic.
4612  Precondition:
4613  None.
4614  Parameters:
4615  index - Identifier for the device instance to be configured
4616  Returns:
4617  None.
4618  Example:
4619  <code>
4620 #define MY_USART_INSTANCE USART_ID_1
4621  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4622  </code>
4623  Remarks:
4624  This feature may not be available on all devices. Please refer to the
4625  specific device data sheet to determine availability or use
4626  PLIB_USART_ExistsRunInOverflow in your application to determine
4627  whether this feature is available.
4628 */
4629 
4630 void
4632  USART_MODULE_ID index ) ;
4633 //******************************************************************************
4634 /* Function:
4635  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
4636  Summary:
4637  Disables the Run in overflow condition mode.
4638  Description:
4639  This function disables the USART module from accepting new data when an overflow
4640  error condition is detected.
4641  This operation is atomic.
4642  Precondition:
4643  None.
4644  Parameters:
4645  index - Identifier for the device instance to be configured
4646  Returns:
4647  None.
4648  Example:
4649  <code>
4650 #define MY_USART_INSTANCE USART_ID_1
4651  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
4652  </code>
4653  Remarks:
4654  This feature may not be available on all devices. Please refer to the
4655  specific device data sheet to determine availability or use
4656  PLIB_USART_ExistsRunInOverflow in your application to determine
4657  whether this feature is available.
4658 */
4659 
4660 void
4662  USART_MODULE_ID index ) ;
4663 //******************************************************************************
4664 /* Function:
4665  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
4666  Summary:
4667  Gets the status of the Run in Overflow condition.
4668  Description:
4669  This function indicates if the USART module has been enabled to run in
4670  an overflow condition.
4671  This operation is atomic.
4672  Precondition:
4673  None.
4674  Parameters:
4675  index - Identifier for the device instance
4676  Returns:
4677  - true - Run in overflow condition is enabled
4678  - false - Run in overflow condition is disabled
4679  Example:
4680  <code>
4681 #define MY_USART_INSTANCE USART_ID_1
4682  bool status;
4683  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
4684  </code>
4685  Remarks:
4686  This feature may not be available on all devices. Please refer to the
4687  specific device data sheet to determine availability or use
4688  PLIB_USART_ExistsRunInOverflow in your application to determine
4689  whether this feature is available.
4690 */
4691 
4692 bool
4694  USART_MODULE_ID index ) ;
4695 //******************************************************************************
4696 /* Function:
4697  void PLIB_USART_BRGClockSourceSelect
4698  (
4699  USART_MODULE_ID index,
4700  USART_BRG_CLOCK_SOURCE brgClockSource
4701  )
4702  Summary:
4703  Configures the BRG clock source of the USART module.
4704  Description:
4705  This function configures the BRG Clock source of the USART. Refer to
4706  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4707  Precondition:
4708  None.
4709  Parameters:
4710  index - Identifier for the device instance to be configured
4711  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
4712  Returns:
4713  None.
4714  Example:
4715  <code>
4716 #define MY_USART_INSTANCE USART_ID_1
4717  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
4718  </code>
4719  Remarks:
4720  This feature may not be available on all devices. Please refer to the
4721  specific device data sheet to determine availability or use
4722  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4723  whether this feature is available.
4724 */
4725 
4726 void
4728  USART_MODULE_ID index ,
4729  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
4730 //******************************************************************************
4731 /* Function:
4732  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
4733  Summary:
4734  Gets the BRG clock source of the USART module.
4735  Description:
4736  This function returns the BRG Clock source of the USART. Refer to
4737  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4738  This operation is atomic.
4739  Precondition:
4740  None.
4741  Parameters:
4742  index - Identifier for the device instance
4743  Returns:
4744  One of the possible values of USART_BRG_CLOCK_SOURCE
4745  Example:
4746  <code>
4747 #define MY_USART_INSTANCE USART_ID_1
4748  USART_BRG_CLOCK_SOURCE brgClockSource;
4749  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
4750  </code>
4751  Remarks:
4752  This feature may not be available on all devices. Please refer to the
4753  specific device data sheet to determine availability or use
4754  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4755  whether this feature is available.
4756 */
4757 
4758 USART_BRG_CLOCK_SOURCE
4760  USART_MODULE_ID index ) ;
4761 //******************************************************************************
4762 /* Function:
4763  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
4764  Summary:
4765  Returns the USART module's running status.
4766  Description:
4767  This function checks if the USART module status is busy. The following
4768  functions should not be used when the module status is busy:
4769  - PLIB_USART_LineControlModeSelect
4770  - PLIB_USART_BaudRateHighSet
4771  - PLIB_USART_BaudRateHighEnable
4772  - PLIB_USART_BaudRateHighDisable
4773  - PLIB_USART_ReceiverIdleStateLowEnable
4774  - PLIB_USART_ReceiverIdleStateLowDisable
4775  - PLIB_USART_BaudRateAutoDetectEnable
4776  - PLIB_USART_LoopbackEnable
4777  - PLIB_USART_LoopbackDisable
4778  - PLIB_USART_WakeOnStartEnable
4779  - PLIB_USART_WakeOnStartDisable
4780  - PLIB_USART_OperationModeSelect
4781  - PLIB_USART_HandshakeModeSelect
4782  - PLIB_USART_IrDAEnable
4783  - PLIB_USART_IrDADisable
4784  - PLIB_USART_StopInIdleEnable
4785  - PLIB_USART_StopInIdleDisable
4786  - PLIB_USART_RunInOverflowEnable
4787  - PLIB_USART_RunInOverflowDisable
4788  - PLIB_USART_BRGClockSourceSelect
4789  - PLIB_USART_RunInSleepModeEnable
4790  - PLIB_USART_RunInSleepModeDisable
4791  This operation is atomic.
4792  Precondition:
4793  None.
4794  Parameters:
4795  index - Identifier for the device instance
4796  Returns:
4797  - true - USART module is busy
4798  - false - USART module is idle
4799  Example:
4800  <code>
4801 #define MY_USART_INSTANCE USART_ID_1
4802  bool moduleStatus;
4803  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
4804  </code>
4805  Remarks:
4806  This feature may not be available on all devices. Please refer to the
4807  specific device data sheet to determine availability or use
4808  PLIB_USART_ExistsModuleBusyStatus in your application to determine
4809  whether this feature is available.
4810 */
4811 
4812 bool
4814  USART_MODULE_ID index ) ;
4815 //******************************************************************************
4816 /* Function:
4817  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
4818  Summary:
4819  Allows the USART module's BRG clock to run when the device enters Sleep mode.
4820  Description:
4821  This function enables the USART module's BRG clock to continue operation when
4822  the device enters the Sleep mode.
4823  This operation is atomic.
4824  Precondition:
4825  None.
4826  Parameters:
4827  index - Identifier for the device instance to be configured
4828  Returns:
4829  None.
4830  Example:
4831  <code>
4832 #define MY_USART_INSTANCE USART_ID_1
4833  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
4834  </code>
4835  Remarks:
4836  This feature may not be available on all devices. Please refer to the
4837  specific device data sheet to determine availability or use
4838  PLIB_USART_ExistsRunInSleepMode in your application to determine
4839  whether this feature is available.
4840 */
4841 
4842 void
4844  USART_MODULE_ID index ) ;
4845 //******************************************************************************
4846 /* Function:
4847  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
4848  Summary:
4849  Turns off the USART module's BRG clock during Sleep mode.
4850  Description:
4851  This function turns off the USART module's BRG clock during Sleep mode.
4852  This operation is atomic.
4853  Precondition:
4854  None.
4855  Parameters:
4856  index - Identifier for the device instance to be configured
4857  Returns:
4858  None.
4859  Example:
4860  <code>
4861 #define MY_USART_INSTANCE USART_ID_1
4862  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
4863  </code>
4864  Remarks:
4865  This feature may not be available on all devices. Please refer to the
4866  specific device data sheet to determine availability or use
4867  PLIB_USART_ExistsRunInSleepMode in your application to determine
4868  whether this feature is available.
4869 */
4870 
4871 void
4873  USART_MODULE_ID index ) ;
4874 //******************************************************************************
4875 /* Function:
4876  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
4877  Summary:
4878  Gets the status of Run in Sleep mode.
4879  Description:
4880  This function indicates if the USART module has been enabled to run in
4881  Sleep mode.
4882  This operation is atomic.
4883  Precondition:
4884  None.
4885  Parameters:
4886  index - Identifier for the device instance
4887  Returns:
4888  - true - Run in Sleep mode is enabled
4889  - false - Run in Sleep mode is disabled
4890  Example:
4891  <code>
4892 #define MY_USART_INSTANCE USART_ID_1
4893  bool status;
4894  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
4895  </code>
4896  Remarks:
4897  This feature may not be available on all devices. Please refer to the
4898  specific device data sheet to determine availability or use
4899  PLIB_USART_ExistsRunInSleepMode in your application to determine
4900  whether this feature is available.
4901 */
4902 
4903 bool
4905  USART_MODULE_ID index ) ;
4906 //******************************************************************************
4907 /* Function:
4908  void PLIB_USART_Enable ( USART_MODULE_ID index )
4909  Summary:
4910  Enables the specific USART module.
4911  Description:
4912  This function enables the specific USART module.
4913  This operation is atomic.
4914  Precondition:
4915  None.
4916  Parameters:
4917  index - Identifier for the device instance to be configured
4918  Returns:
4919  None.
4920  Example:
4921  <code>
4922 #define MY_USART_INSTANCE USART_ID_1
4923  PLIB_USART_Enable(MY_USART_INSTANCE);
4924  </code>
4925  Remarks:
4926  By calling this function, the USART pins are controlled by the USART
4927  module.
4928  This feature may not be available on all devices. Please refer to the
4929  specific device data sheet to determine availability or use
4930  PLIB_USART_ExistsEnable in your application to determine whether
4931  this feature is available.
4932 */
4933 
4934 void
4936  USART_MODULE_ID index ) ;
4937 //******************************************************************************
4938 /* Function:
4939  void PLIB_USART_Disable ( USART_MODULE_ID index )
4940  Summary:
4941  Disables the specific USART module
4942  Description:
4943  This function disables the specific USART module.
4944  This operation is atomic.
4945  Precondition:
4946  None.
4947  Parameters:
4948  index - Identifier for the device instance to be configured
4949  Returns:
4950  None.
4951  Example:
4952  <code>
4953 #define MY_USART_INSTANCE USART_ID_1
4954  PLIB_USART_Disable(MY_USART_INSTANCE);
4955  </code>
4956  Remarks:
4957  The default state after any reset for a USART module is the disable state.
4958  If the USART is disabled, all of the related pins are in control of the
4959  general purpose I/O logic.
4960 
4961  Disabling the USART module resets the buffers to empty states. Any data
4962  characters in the buffers are lost and the baud rate is reset. All error
4963  and status bits are also reset.
4964 
4965  Disabling the USART while the USART is active, will abort all pending
4966  transmissions and receptions. Re-enabling the USART will restart the
4967  module in the same configuration.
4968 
4969  When disabled, the USART power consumption is minimal.
4970  This feature may not be available on all devices. Please refer to the
4971  specific device data sheet to determine availability or use
4972  PLIB_USART_ExistsEnable in your application to determine whether
4973  this feature is available.
4974 */
4975 
4976 void
4978  USART_MODULE_ID index ) ;
4979 //******************************************************************************
4980 /* Function:
4981  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
4982  Summary:
4983  Enables the specific USART module transmitter.
4984  Description:
4985  This function enables the specific USART module transmitter.
4986  This operation is atomic.
4987  Precondition:
4988  The USART module should be enabled using the function PLIB_USART_Enable
4989  before this function is called.
4990  Parameters:
4991  index - Identifier for the device instance to be configured
4992  Returns:
4993  None.
4994  Example:
4995  <code>
4996 #define MY_USART_INSTANCE USART_ID_1
4997  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
4998  </code>
4999  Remarks:
5000  The transmitter should not be enabled until the USART is enabled.
5001  The transmissions will not be enabled otherwise.
5002 
5003  This feature may not be available on all devices. Please refer to the
5004  specific device data sheet to determine availability or use
5005  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
5006  this feature is available.
5007 */
5008 
5009 void
5011  USART_MODULE_ID index ) ;
5012 //******************************************************************************
5013 /* Function:
5014  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
5015  Summary:
5016  Disables the specific USART module transmitter.
5017  Description:
5018  This function disables the specific USART module transmitter.
5019  This operation is atomic.
5020  Precondition:
5021  None.
5022  Parameters:
5023  index - Identifier for the device instance to be configured
5024  Returns:
5025  None.
5026  Example:
5027  <code>
5028 #define MY_USART_INSTANCE USART_ID_1
5029  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
5030  </code>
5031  Remarks:
5032  Disabling the transmitter during a transmission will cause the
5033  transmission to be aborted.
5034 
5035  This feature may not be available on all devices. Please refer to the
5036  specific device data sheet to determine availability or use
5037  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
5038  this feature is available.
5039 */
5040 
5041 void
5043  USART_MODULE_ID index ) ;
5044 //******************************************************************************
5045 /* Function:
5046  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
5047  uint32_t baudRate );
5048  Summary:
5049  Sets the baud rate to the desired value.
5050  Description:
5051  This function sets the baud rate to the desired value.
5052  Precondition:
5053  None.
5054  Parameters:
5055  index - Identifier for the device instance to be configured
5056  baudRate - Baud Rate Value
5057  clockFrequency - Clock Frequency
5058  Returns:
5059  None.
5060  Example:
5061  <code>
5062 #define MY_USART_INSTANCE USART_ID_1
5063  uint32_t baudRateValue ;
5064  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5065  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5066  </code>
5067  Remarks:
5068  Setting a new baud rate value causes the baud rate timer to reset.
5069  This ensures that the baud rate timer does not have to overflow before
5070  outputting the new baud rate.
5071 
5072  If the system clock is changed during an active receive operation, a
5073  receiver error or data loss may result. To avoid this issue verify that
5074  no receptions are in progress before changing the system clock.
5075 
5076  This feature may not be available on all devices. Please refer to the
5077  specific device data sheet to determine availability or use
5078  PLIB_USART_ExistsBaudRate in your application to determine whether
5079  this feature is available.
5080 */
5081 
5082 void
5084  USART_MODULE_ID index ,
5085  uint32_t clockFrequency ,
5086  uint32_t baudRate ) ;
5087 //******************************************************************************
5088 /* Function:
5089  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
5090  uint32_t clockFrequency, uint32_t baudRate );
5091  Summary:
5092  Sets the baud rate to the desired value.
5093  Description:
5094  This function sets the baud rate to the desired value.
5095  Precondition:
5096  None.
5097  Parameters:
5098  index - Identifier for the device instance to be configured
5099  baudRate - Baud Rate Value, it is the baud rate value
5100  clockFrequency - Clock Frequency
5101  Returns:
5102  None.
5103  Example:
5104  <code>
5105 #define MY_USART_INSTANCE USART_ID_1
5106  uint32_t baudRateValue ;
5107  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5108  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5109  </code>
5110  Remarks:
5111  Setting a new baud rate value causes the baud rate timer to reset.
5112  This ensures that the baud rate timer does not have to overflow before
5113  outputting the new baud rate.
5114 
5115  If the system clock is changed during an active receive operation, a
5116  receiver error or data loss may result. To avoid this issue verify that
5117  no receptions are in progress before changing the system clock.
5118 
5119  This feature may not be available on all devices. Please refer to the
5120  specific device data sheet to determine availability or use
5121  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5122  this feature is available.
5123 */
5124 
5125 void
5127  USART_MODULE_ID index ,
5128  uint32_t clockFrequency ,
5129  uint32_t baudRate ) ;
5130 //******************************************************************************
5131 /* Function:
5132  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5133  int32_t clockFrequency );
5134  Summary:
5135  Gets the baud rate current in use.
5136  Description:
5137  This function gets the baud rate that is currently in use. The clock frequency
5138  needs to be passed to the function.
5139  Conditions:
5140  None.
5141  Input:
5142  index - Identifier for the device instance to be configured
5143  clockFrequency - Clock Frequency
5144  Returns:
5145  - BaudRate - Baud rate value
5146  Example:
5147  <code>
5148 #define MY_USART_INSTANCE USART_ID_1
5149  uint32_t baudRate ;
5150  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5151  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5152  </code>
5153  Remarks:
5154  This feature may not be available on all devices. Please refer to the
5155  specific device data sheet to determine availability or use
5156  PLIB_USART_ExistsBaudRate in your application to determine whether
5157  this feature is available.
5158 */
5159 
5160 uint32_t
5162  USART_MODULE_ID index ,
5163  int32_t clockFrequency ) ;
5164 //******************************************************************************
5165 /* Function:
5166  void PLIB_USART_AddressSet
5167  (
5168  USART_MODULE_ID index,
5169  uint8_t address
5170  )
5171  Summary:
5172  Sets the address for the Address Detect mode.
5173  Description:
5174  This function sets the address for the Address Detect mode.
5175  This operation is atomic.
5176  Precondition:
5177  None.
5178  Parameters:
5179  index - Identifier for the device instance to be configured
5180  address - Address
5181  Returns:
5182  None.
5183  Example:
5184  <code>
5185 #define MY_USART_INSTANCE USART_ID_1
5186  uint8_t address = 0x02;
5187  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5188  </code>
5189  Remarks:
5190  This feature may not be available on all devices. Please refer to the
5191  specific device data sheet to determine availability or use
5192  PLIB_USART_ExistsReceiverAddress in your application to determine
5193  whether this feature is available.
5194 */
5195 
5196 void
5198  USART_MODULE_ID index ,
5199  uint8_t address ) ;
5200 //******************************************************************************
5201 /* Function:
5202  uint8_t PLIB_USART_AddressGet
5203  (
5204  USART_MODULE_ID index
5205  )
5206  Summary:
5207  Gets the address for the Address Detect mode.
5208  Description:
5209  This function returns the address value being used for the Address
5210  Detect mode.
5211  This operation is atomic.
5212  Precondition:
5213  None.
5214  Parameters:
5215  index - Identifier for the device instance
5216  Returns:
5217  - address - The address being used
5218  Example:
5219  <code>
5220 #define MY_USART_INSTANCE USART_ID_1
5221  uint8_t address = 0;
5222  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5223  </code>
5224  Remarks:
5225  This feature may not be available on all devices. Please refer to the
5226  specific device data sheet to determine availability or use
5227  PLIB_USART_ExistsReceiverAddress in your application to determine
5228  whether this feature is available.
5229 */
5230 
5231 uint8_t
5233  USART_MODULE_ID index ) ;
5234 //******************************************************************************
5235 /* Function:
5236  void PLIB_USART_AddressMaskSet
5237  (
5238  USART_MODULE_ID index,
5239  uint8_t mask
5240  )
5241  Summary:
5242  Sets the address mask for the Address Detect mode.
5243  Description:
5244  This function sets the address mask for the Address Detect mode.
5245  This operation is atomic.
5246  Precondition:
5247  None.
5248  Parameters:
5249  index - Identifier for the device instance to be configured
5250  mask - Address match mask bits
5251  Returns:
5252  None.
5253  Example:
5254  <code>
5255 #define MY_USART_INSTANCE USART_ID_1
5256  uint8_t mask = 0x0F;
5257  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5258  </code>
5259  Remarks:
5260  This feature may not be available on all devices. Please refer to the
5261  specific device data sheet to determine availability or use
5262  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5263  whether this feature is available.
5264 */
5265 
5266 void
5268  USART_MODULE_ID index ,
5269  uint8_t mask ) ;
5270 //******************************************************************************
5271 /* Function:
5272  uint8_t PLIB_USART_AddressMaskGet
5273  (
5274  USART_MODULE_ID index
5275  )
5276  Summary:
5277  Gets the address mask for the Address Detect mode.
5278  Description:
5279  This function returns the address mask value being used for the Address
5280  Detect mode.
5281  This operation is atomic.
5282  Precondition:
5283  None.
5284  Parameters:
5285  index - Identifier for the device instance to be configured
5286  Returns:
5287  - mask - Address mask being used
5288  Example:
5289  <code>
5290 #define MY_USART_INSTANCE USART_ID_1
5291  uint8_t mask = 0;
5292  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5293  </code>
5294  Remarks:
5295  This feature may not be available on all devices. Please refer to the
5296  specific device data sheet to determine availability or use
5297  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5298  whether this feature is available.
5299 */
5300 
5301 uint8_t
5303  USART_MODULE_ID index ) ;
5304 //******************************************************************************
5305 /* Function:
5306  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5307  Summary:
5308  Enables the Address Detect mode.
5309  Description:
5310  This function enables the Address Detect mode. If it is enabled, and the
5311  device is addressed, disable the Address Detect mode to continue receiving
5312  bytes.
5313  This operation is atomic.
5314  Precondition:
5315  None.
5316  Parameters:
5317  index - Identifier for the device instance to be configured
5318  Returns:
5319  None.
5320  Example:
5321  <code>
5322 #define MY_USART_INSTANCE USART_ID_1
5323  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5324  </code>
5325  Remarks:
5326  If 9 data bits are not selected, this bit has no effect.
5327  This feature may not be available on all devices. Please refer to the
5328  specific device data sheet to determine availability or use
5329  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5330  this feature is available.
5331 */
5332 
5333 void
5335  USART_MODULE_ID index ) ;
5336 //******************************************************************************
5337 /* Function:
5338  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5339  Summary:
5340  Enables the Address Detect mode.
5341  Description:
5342  This function disables the Address Detect mode. If it is enabled, and the
5343  device is addressed, disable the Address Detect mode to continue receiving
5344  bytes.
5345  This operation is atomic.
5346  Precondition:
5347  None.
5348  Parameters:
5349  index - Identifier for the device instance to be configured
5350  Returns:
5351  None.
5352  Example:
5353  <code>
5354 #define MY_USART_INSTANCE USART_ID_1
5355  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5356  </code>
5357  Remarks:
5358  All bytes are received, and the 9th bit can be used as the parity bit.
5359  By default, the address detect is disabled.
5360 
5361  This feature may not be available on all devices. Please refer to the
5362  specific device data sheet to determine availability or use
5363  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5364  this feature is available.
5365 */
5366 
5367 void
5369  USART_MODULE_ID index ) ;
5370 //******************************************************************************
5371 /* Function:
5372  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5373  Summary:
5374  Gets the state of the automatic baud detection.
5375  Description:
5376  This function gets the state of the automatic baud detection and returns a '0'
5377  if the baud rate auto detection is complete.
5378  This operation is atomic.
5379  Precondition:
5380  None.
5381  Parameters:
5382  index - Identifier for the device instance to be configured
5383  Returns:
5384  - true - Baud rate detection is not complete
5385  - false - Baud rate detection is complete
5386  Example:
5387  <code>
5388 #define MY_USART_INSTANCE USART_ID_1
5389  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5390  // Wait until the baud rate is detected.
5391  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5392  </code>
5393  Remarks:
5394  This feature may not be available on all devices. Please refer to the
5395  specific device data sheet to determine availability or use
5396  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5397  this feature is available.
5398 */
5399 
5400 bool
5402  USART_MODULE_ID index ) ;
5403 //******************************************************************************
5404 /* Function:
5405  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5406  Summary:
5407  Enables baud rate measurement on the next character, which requires reception
5408  of the Sync character.
5409  Description:
5410  This function enables the baud rate measurement on the next character,
5411  which requires reception of the Sync character.
5412  This operation is atomic.
5413  Precondition:
5414  None.
5415  Parameters:
5416  index - Identifier for the device instance to be configured
5417  Returns:
5418  None.
5419  Example:
5420  <code>
5421 #define MY_USART_INSTANCE USART_ID_1
5422  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5423  // Wait until the baud rate is detected.
5424  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5425  </code>
5426  Remarks:
5427  This feature may not be available on all devices. Please refer to the
5428  specific device data sheet to determine availability or use
5429  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5430  this feature is available.
5431 */
5432 
5433 void
5435  USART_MODULE_ID index ) ;
5436 //******************************************************************************
5437 /* Function:
5438  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5439  Summary:
5440  Data to be transmitted in the Byte mode.
5441  Description:
5442  The data is transmitted in the Byte mode for the specified USART module.
5443  This operation is atomic.
5444  Precondition:
5445  None.
5446  Parameters:
5447  index - Identifier for the device instance to be configured
5448  data - Data to be transmitted.
5449  Returns:
5450  None.
5451  Example:
5452  <code>
5453 #define MY_USART_INSTANCE USART_ID_1
5454  uint8_t data = 'a';
5455  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5456  {
5457  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5458  }
5459  </code>
5460  Remarks:
5461  This feature may not be available on all devices. Please refer to the
5462  specific device data sheet to determine availability or use
5463  PLIB_USART_ExistsTransmitter in your application to determine whether
5464  this feature is available.
5465 */
5466 
5467 void
5469  USART_MODULE_ID index ,
5470  int8_t data ) ;
5471 //******************************************************************************
5472 /* Function:
5473  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5474  Summary:
5475  Data to be received in the Byte mode.
5476  Description:
5477  The data to be received in Byte mode from the specified USART module.
5478  This operation is atomic.
5479  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5480  PLIB_USART_ReceiverParityErrorHasOccurred and
5481  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5482  Precondition:
5483  None.
5484  Parameters:
5485  index - Identifier for the device instance to be configured
5486  Returns:
5487  - data - Data to be received
5488  Example:
5489  <code>
5490 #define MY_USART_INSTANCE USART_ID_1
5491  bool isError;
5492  uint8_t mydata;
5493  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5494  {
5495  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5496  }
5497  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5498  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5499  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5500  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5501  {
5502  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5503  }
5504  </code>
5505  Remarks:
5506  This feature may not be available on all devices. Please refer to the
5507  specific device data sheet to determine availability or use
5508  PLIB_USART_ExistsReceiver in your application to determine whether
5509  this feature is available.
5510 */
5511 
5512 int8_t
5514  USART_MODULE_ID index ) ;
5515 //******************************************************************************
5516 /* Function:
5517  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5518  Summary:
5519  Data to be received in the byte mode with the 9th bit.
5520  Description:
5521  The data to be received in Byte mode from the specified USART module.
5522  with the 9th bit.
5523  This operation is atomic.
5524  Precondition:
5525  None.
5526  Parameters:
5527  index - Identifier for the device instance to be configured
5528  Returns:
5529  - data - Data to be received
5530  Example:
5531  <code>
5532 #define MY_USART_INSTANCE USART_ID_1
5533  uint16_t mydata;
5534  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5535  {
5536  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5537  }
5538  </code>
5539  Remarks:
5540  This feature may not be available on all devices. Please refer to the
5541  specific device data sheet to determine availability or use
5542  PLIB_USART_ExistsReceiver9Bits in your application to determine
5543  whether this feature is available.
5544 */
5545 
5546 int16_t
5548  USART_MODULE_ID index ) ;
5549 //******************************************************************************
5550 /* Function:
5551  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5552  Summary:
5553  Checks and return if the data received is an address.
5554  Description:
5555  Checks and return if the data received is an address. The address has
5556  the 9th bit set. If data received has the 9th bit set, the function returns true;
5557  otherwise, the function returns false.
5558  This operation is atomic.
5559  Precondition:
5560  The USART module should be configured to use the 9 data bits.
5561  Parameters:
5562  index - Identifier for the device instance to be configured
5563  Returns:
5564  - true - if the data received has the 9th bit set
5565  - false - if the address received has the 9th bit cleared
5566  Example:
5567  <code>
5568 #define MY_USART_INSTANCE USART_ID_1
5569  int8_t address;
5570  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5571  {
5572  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5573  }
5574  </code>
5575  Remarks:
5576  This feature may not be available on all devices. Please refer to the
5577  specific device data sheet to determine availability or use
5578  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5579  this feature is available.
5580 */
5581 
5582 bool
5584  USART_MODULE_ID index ) ;
5585 //******************************************************************************
5586 /* Function:
5587  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5588  int8_t data, bool 9thBit )
5589  Summary:
5590  Data to be transmitted in the byte mode with the 9th bit.
5591  Description:
5592  The data is transmitted in the byte mode for the specified USART module,
5593  with 9th bit.
5594  This operation is atomic.
5595  Precondition:
5596  The USART module should be configured to use the 9 data bits.
5597  Parameters:
5598  index - Identifier for the device instance to be configured
5599  data - Data to be transmitted.
5600  9thBit - 9th bit of the data to be transmitted.
5601  Returns:
5602  None.
5603  Example:
5604  <code>
5605 #define MY_USART_INSTANCE USART_ID_1
5606  uint8_t data = 'a';
5607  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5608  {
5609  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5610  }
5611  </code>
5612  Remarks:
5613  This feature may not be available on all devices. Please refer to the
5614  specific device data sheet to determine availability or use
5615  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5616  this feature is available.
5617 */
5618 
5619 void
5621  USART_MODULE_ID index ,
5622  int8_t data ,
5623  bool Bit9th ) ;
5624 //******************************************************************************
5625 /* Function:
5626  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5627  Summary:
5628  Transmits the break character.
5629  Description:
5630  This function transmits the break character.
5631  This operation is atomic.
5632  Precondition:
5633  The application should wait for the transmitter to be idle, before calling
5634  this function.
5635  Parameters:
5636  index - Identifier for the device instance to be configured
5637  Returns:
5638  None.
5639  Example:
5640  <code>
5641 #define MY_USART_INSTANCE USART_ID_1
5642  // Wait for the Transmit buffer to be empty.
5643  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5644  // Transmit the break character.
5645  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5646  // wait for the break transmission to complete
5647  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5648  </code>
5649  Remarks:
5650  After the break has been transmitted, the application can start
5651  transmitting next bytes.
5652 
5653  This feature may not be available on all devices. Please refer to the
5654  specific device data sheet to determine availability or use
5655  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5656  this feature is available.
5657 */
5658 
5659 void
5661  USART_MODULE_ID index ) ;
5662 //******************************************************************************
5663 /* Function:
5664  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
5665  Summary:
5666  Returns the status of the break transmission
5667  Description:
5668  The function returns the status of the break transmission.
5669  This operation is atomic.
5670  Precondition:
5671  None.
5672  Parameters:
5673  index - Identifier for the device instance to be configured
5674  Returns:
5675  - true - Transmit break on the next transmission
5676  - false - Break transmission completed or not started
5677  Example:
5678  <code>
5679 #define MY_USART_INSTANCE USART_ID_1
5680  // Wait for the Transmit buffer to be empty.
5681  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5682  // Transmit the break character.
5683  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5684  // wait for the break transmission to complete
5685  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5686  </code>
5687  Remarks:
5688  After the break has been transmitted, the application can start
5689  transmitting next bytes.
5690 
5691  This feature may not be available on all devices. Please refer to the
5692  specific device data sheet to determine availability or use
5693  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5694  this feature is available.
5695 */
5696 
5697 bool
5699  USART_MODULE_ID index ) ;
5700 //******************************************************************************
5701 /* Function:
5702  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
5703  Summary:
5704  Identifies if the receive data is available for the specified USART module.
5705  Description:
5706  This function identifies if the receive data is available for the specified
5707  USART module.
5708  This operation is atomic.
5709  Precondition:
5710  None.
5711  Parameters:
5712  index - Identifier for the device instance to be configured
5713  Returns:
5714  - true - The data is available
5715  - false - The data is not available
5716  Example:
5717  <code>
5718 #define MY_USART_INSTANCE USART_ID_1
5719  int8_t mydata;
5720  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5721  {
5722  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5723  }
5724  </code>
5725  Remarks:
5726  This feature may not be available on all devices. Please refer to the
5727  specific device data sheet to determine availability or use
5728  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
5729  whether this feature is available.
5730 */
5731 
5732 bool
5734  USART_MODULE_ID index ) ;
5735 //******************************************************************************
5736 /* Function:
5737  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
5738  Summary:
5739  Clears a USART vverrun error.
5740  Description:
5741  This function clears an overrun error. Clearing the error, resets the receive buffer.
5742  This operation is atomic.
5743  Precondition:
5744  None.
5745  Parameters:
5746  index - Identifier for the device instance to be configured
5747  Returns:
5748  None.
5749  Example:
5750  <code>
5751 #define MY_USART_INSTANCE USART_ID_1
5752  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5753  {
5754  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5755  }
5756  </code>
5757  Remarks:
5758  WARNING: Calling this API will clear all of the previously received data.
5759 
5760  This feature may not be available on all devices. Please refer to the
5761  specific device data sheet to determine availability or use
5762  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5763  whether this feature is available.
5764 */
5765 
5766 void
5768  USART_MODULE_ID index ) ;
5769 //******************************************************************************
5770 /* Function:
5771  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
5772  Summary:
5773  Gets the transmit buffer full status.
5774  Description:
5775  This function gets the transmit status of the specified USART module.
5776  This operation is atomic.
5777  Precondition:
5778  None.
5779  Parameters:
5780  index - Identifier for the device instance to be configured
5781  Returns:
5782  - true - The transmit buffer is full
5783  - false - The transmit buffer is not full, at least one more
5784  character can be written
5785  Example:
5786  <code>
5787 #define MY_USART_INSTANCE USART_ID_1
5788  // Wait for the Transmit buffer to be empty.
5789  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5790  // Transmit the break character.
5791  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5792  </code>
5793  Remarks:
5794  This feature may not be available on all devices. Please refer to the
5795  specific device data sheet to determine availability or use
5796  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
5797  whether this feature is available.
5798 */
5799 
5800 bool
5802  USART_MODULE_ID index ) ;
5803 //******************************************************************************
5804 /* Function:
5805  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
5806  Summary:
5807  Gets the transmit shift register empty status.
5808  Description:
5809  This function gets the transmit shift register empty status.
5810  This operation is atomic.
5811  Precondition:
5812  None.
5813  Parameters:
5814  index - Identifier for the device instance to be configured
5815  Returns:
5816  - true - The transmit shift register is empty
5817  - false - The transmit shift register is not empty
5818  Example:
5819  <code>
5820 #define MY_USART_INSTANCE USART_ID_1
5821  // Wait for the Transmit buffer to be empty.
5822  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
5823  // Transmit the break character.
5824  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5825  </code>
5826  Remarks:
5827  This feature may not be available on all devices. Please refer to the
5828  specific device data sheet to determine availability or use
5829  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
5830  whether this feature is available.
5831 */
5832 
5833 bool
5835  USART_MODULE_ID index ) ;
5836 //******************************************************************************
5837 /* Function:
5838  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
5839  Summary:
5840  Gets the framing error status.
5841  Description:
5842  This function gets the framing error status.
5843  This operation is atomic.
5844  Precondition:
5845  None.
5846  Parameters:
5847  index - Identifier for the device instance to be configured
5848  Returns:
5849  - true - The framing error was detected on the current character
5850  - false - The framing error was not detected on the current
5851  character
5852  Example:
5853  <code>
5854 #define MY_USART_INSTANCE USART_ID_1
5855  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
5856  </code>
5857  Remarks:
5858  Reading the error clears the error.
5859  This feature may not be available on all devices. Please refer to the
5860  specific device data sheet to determine availability or use
5861  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
5862  whether this feature is available.
5863 */
5864 
5865 bool
5867  USART_MODULE_ID index ) ;
5868 //******************************************************************************
5869 /* Function:
5870  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
5871  Summary:
5872  Gets the parity error status.
5873  Description:
5874  This function gets the parity error status.
5875  This operation is atomic.
5876  Precondition:
5877  None.
5878  Parameters:
5879  index - Identifier for the device instance to be configured
5880  Returns:
5881  - true - The parity error was detected on the current character
5882  - false - The parity error was not detected on the current character
5883  Example:
5884  <code>
5885 #define MY_USART_INSTANCE USART_ID_1
5886  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
5887  </code>
5888  Remarks:
5889  Reading the error clears the error.
5890  A Parity error is irrelevant in case of 9-bit mode.
5891  This feature may not be available on all devices. Please refer to the
5892  specific device data sheet to determine availability or use
5893  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
5894  whether this feature is available.
5895 */
5896 
5897 bool
5899  USART_MODULE_ID index ) ;
5900 //******************************************************************************
5901 /* Function:
5902  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
5903  Summary:
5904  Identifies if there was a receiver overrun error.
5905  Description:
5906  This function identifies if there was a receiver overrun error.
5907  This operation is atomic.
5908  Precondition:
5909  None.
5910  Parameters:
5911  index - Identifier for the device instance to be configured
5912  Returns:
5913  - true - The receive buffer has overflowed
5914  - false - The receive buffer has not overflowed
5915  Example:
5916  <code>
5917 #define MY_USART_INSTANCE USART_ID_1
5918  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5919  {
5920  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5921  }
5922  </code>
5923  Remarks:
5924  This feature may not be available on all devices. Please refer to the
5925  specific device data sheet to determine availability or use
5926  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5927  whether this feature is available.
5928 */
5929 
5930 bool
5932  USART_MODULE_ID index ) ;
5933 //******************************************************************************
5934 /* Function:
5935  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
5936  Summary:
5937  Identifies if the receiver is idle.
5938  Description:
5939  This function identifies if the receiver is idle.
5940  This operation is atomic.
5941  Precondition:
5942  None.
5943  Parameters:
5944  index - Identifier for the device instance to be configured
5945  Returns:
5946  - true - The receive buffer is idle
5947  - false - The receive buffer is not idle
5948  Example:
5949  <code>
5950 #define MY_USART_INSTANCE USART_ID_1
5951  int8_t mydata;
5952  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
5953  {
5954  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5955  }
5956  </code>
5957  Remarks:
5958  This feature may not be available on all devices. Please refer to the
5959  specific device data sheet to determine availability or use
5960  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
5961  whether this feature is available.
5962 */
5963 
5964 bool
5966  USART_MODULE_ID index ) ;
5967 //******************************************************************************
5968 /* Function:
5969  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
5970  Summary:
5971  Enables the USART receiver.
5972  Description:
5973  This function enables the USART receiver.
5974  This operation is atomic.
5975  Precondition:
5976  None.
5977  Parameters:
5978  index - Identifier for the device instance to be configured
5979  Returns:
5980  None.
5981  Example:
5982  <code>
5983 #define MY_USART_INSTANCE USART_ID_1
5984  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
5985  </code>
5986  Remarks:
5987  This feature may not be available on all devices. Please refer to the
5988  specific device data sheet to determine availability or use
5989  PLIB_USART_ExistsReceiverEnable in your application to determine
5990  whether this feature is available.
5991 */
5992 
5993 void
5995  USART_MODULE_ID index ) ;
5996 //******************************************************************************
5997 /* Function:
5998  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
5999  Summary:
6000  Disables the USART receiver.
6001  Description:
6002  This function disables the USART receiver.
6003  This operation is atomic.
6004  Precondition:
6005  None.
6006  Parameters:
6007  index - Identifier for the device instance to be configured
6008  Returns:
6009  None.
6010  Example:
6011  <code>
6012 #define MY_USART_INSTANCE USART_ID_1
6013  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
6014  </code>
6015  Remarks:
6016  This feature may not be available on all devices. Please refer to the
6017  specific device data sheet to determine availability or use
6018  PLIB_USART_ExistsReceiverEnable in your application to determine
6019  whether this feature is available.
6020 */
6021 
6022 void
6024  USART_MODULE_ID index ) ;
6025 //******************************************************************************
6026 /* Function:
6027  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
6028  Summary:
6029  Enables the Transmit Idle Low state.
6030  Description:
6031  This function enables the Transmit Idle Low state. In the USART Synchronous
6032  mode, this function configures that the TX polarity, the idle state is low.
6033  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
6034  state to a '1'.
6035  This operation is atomic.
6036  Precondition:
6037  None.
6038  Parameters:
6039  index - Identifier for the device instance to be configured
6040  Returns:
6041  None.
6042  Example:
6043  <code>
6044 #define MY_USART_INSTANCE USART_ID_1
6045  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
6046  </code>
6047  Remarks:
6048  This feature may not be available on all devices. Please refer to the
6049  specific device data sheet to determine availability or use
6050  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
6051  whether this feature is available.
6052 */
6053 
6054 void
6056  USART_MODULE_ID index ) ;
6057 //******************************************************************************
6058 /* Function:
6059  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
6060  Summary:
6061  Disables the Transmit Idle Low state.
6062  Description:
6063  This function disables the Transmit Idle Low state. In USART Synchronous mode,
6064  this function configures that the TX polarity the idle state is high.
6065  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
6066  state to a '0'.
6067  This operation is atomic.
6068  Precondition:
6069  None.
6070  Parameters:
6071  index - Identifier for the device instance to be configured
6072  Returns:
6073  None.
6074  Example:
6075  <code>
6076 #define MY_USART_INSTANCE USART_ID_1
6077  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
6078  </code>
6079  Remarks:
6080  This feature may not be available on all devices. Please refer to the
6081  specific device data sheet to determine availability or use
6082  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
6083  whether this feature is available.
6084 */
6085 
6086 void
6088  USART_MODULE_ID index ) ;
6089 //******************************************************************************
6090 /* Function:
6091  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6092  Summary:
6093  Enables receive polarity inversion.
6094  Description:
6095  This function enables receive polarity inversion. In the USART Synchronous mode,
6096  this function configures that the data is inverted.
6097  This operation is atomic.
6098  Precondition:
6099  None.
6100  Parameters:
6101  index - Identifier for the device instance to be configured
6102  Returns:
6103  None.
6104  Example:
6105  <code>
6106 #define MY_USART_INSTANCE USART_ID_1
6107  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6108  </code>
6109  Remarks:
6110  This feature may not be available on all devices. Please refer to the
6111  specific device data sheet to determine availability or use
6112  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6113  whether this feature is available.
6114 */
6115 
6116 void
6118  USART_MODULE_ID index ) ;
6119 //******************************************************************************
6120 /* Function:
6121  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6122  Summary:
6123  Disables receive polarity inversion.
6124  This operation is atomic.
6125  Description:
6126  This function disables receive polarity inversion. In the USART Synchronous
6127  mode, this function configures that the data is not inverted.
6128  Precondition:
6129  None.
6130  Parameters:
6131  index - Identifier for the device instance to be configured
6132  Returns:
6133  None.
6134  Example:
6135  <code>
6136 #define MY_USART_INSTANCE USART_ID_1
6137  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6138  </code>
6139  Remarks:
6140  This feature may not be available on all devices. Please refer to the
6141  specific device data sheet to determine availability or use
6142  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6143  whether this feature is available.
6144 */
6145 
6146 void
6148  USART_MODULE_ID index ) ;
6149 //******************************************************************************
6150 /* Function:
6151  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6152  Summary:
6153  Enables high baud rate selection.
6154  Description:
6155  This function enables high baud rate selection.
6156  This operation is atomic.
6157  Precondition:
6158  None.
6159  Parameters:
6160  index - Identifier for the device instance to be configured
6161  Returns:
6162  None.
6163  Example:
6164  <code>
6165 #define MY_USART_INSTANCE USART_ID_1
6166  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6167  </code>
6168  Remarks:
6169  This feature may not be available on all devices. Please refer to the
6170  specific device data sheet to determine availability or use
6171  PLIB_USART_ExistsBaudRateHigh in your application to determine
6172  whether this feature is available.
6173 */
6174 
6175 void
6177  USART_MODULE_ID index ) ;
6178 //******************************************************************************
6179 /* Function:
6180  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6181  Summary:
6182  Disables the high baud rate selection.
6183  Description:
6184  This function disables the high baud rate selection.
6185  This operation is atomic.
6186  Precondition:
6187  None.
6188  Parameters:
6189  index - Identifier for the device instance to be configured
6190  Returns:
6191  None.
6192  Example:
6193  <code>
6194 #define MY_USART_INSTANCE USART_ID_1
6195  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6196  </code>
6197  Remarks:
6198  This feature may not be available on all devices. Please refer to the
6199  specific device data sheet to determine availability or use
6200  PLIB_USART_ExistsBaudRateHigh in your application to determine
6201  whether this feature is available.
6202 */
6203 
6204 void
6206  USART_MODULE_ID index ) ;
6207 //******************************************************************************
6208 /* Function:
6209  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6210  USART_TRANSMIT_INTR_MODE interruptMode )
6211  Summary:
6212  Sets the USART transmitter interrupt mode.
6213  Description:
6214  This function sets the condition in which the USART module should generate
6215  an interrupt.
6216  This operation is atomic.
6217  Precondition:
6218  None.
6219  Parameters:
6220  index - Identifier for the device instance to be configured
6221  interruptMode - Interrupt mode; for possible configurations, refer to
6222  USART_TRANSMIT_INTR_MODE
6223  Returns:
6224  None.
6225  Example:
6226  <code>
6227 #define MY_USART_INSTANCE USART_ID_1
6228  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6229  USART_TRANSMIT_FIFO_EMPTY );
6230  </code>
6231  Remarks:
6232  This feature may not be available on all devices. Please refer to the
6233  specific device data sheet to determine availability or use
6234  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6235  whether this feature is available.
6236 */
6237 
6238 void
6240  USART_MODULE_ID index ,
6241  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6242 //******************************************************************************
6243 /* Function:
6244  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6245  USART_RECEIVE_INTR_MODE interruptMode )
6246  Summary:
6247  Sets the USART receiver FIFO level.
6248  Description:
6249  This function sets the USART receiver FIFO level.
6250  This operation is atomic.
6251  Precondition:
6252  None.
6253  Parameters:
6254  index - Identifier for the device instance to be configured
6255  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6256  Returns:
6257  None.
6258  Example:
6259  <code>
6260 #define MY_USART_INSTANCE USART_ID_1
6261  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6262  USART_RECEIVE_FIFO_ONE_CHAR );
6263  </code>
6264  Remarks:
6265  This feature may not be available on all devices. Please refer to the
6266  specific device data sheet to determine availability or use
6267  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6268  whether this feature is available.
6269 */
6270 
6271 void
6273  USART_MODULE_ID index ,
6274  USART_RECEIVE_INTR_MODE interruptMode ) ;
6275 //******************************************************************************
6276 /* Function:
6277  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6278  USART_LINECONTROL_MODE dataFlowConfig)
6279  Summary:
6280  Sets the data flow configuration.
6281  Description:
6282  This function sets the USART data flow configuration based on the mask
6283  provided and the specified baud rate.
6284  Precondition:
6285  None.
6286  Parameters:
6287  index - Identifier for the device instance to be configured
6288  mode - For possible data flow configurations, refer to
6289  USART_LINECONTROL_MODE
6290  Returns:
6291  None.
6292  Example:
6293  <code>
6294 #define MY_USART_INSTANCE USART_ID_1
6295  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6296  USART_8N1);
6297  </code>
6298  Remarks:
6299  This feature may not be available on all devices. Please refer to the
6300  specific device data sheet to determine availability or use
6301  PLIB_USART_ExistsLineControlMode in your application to determine
6302  whether this feature is available.
6303 */
6304 
6305 void
6307  USART_MODULE_ID index ,
6308  USART_LINECONTROL_MODE dataFlowConfig ) ;
6309 //******************************************************************************
6310 /* Function:
6311  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6312  USART_HANDSHAKE_MODE handshakeConfig)
6313  Summary:
6314  Sets the data flow configuration.
6315  Description:
6316  This function sets the USART data flow configuration based on the mask
6317  provided and the specified baud rate.
6318  Precondition:
6319  None.
6320  Parameters:
6321  index - Identifier for the device instance to be configured
6322  mode - For possible data flow configurations, refer to
6323  USART_HANDSHAKE_MODE
6324  Returns:
6325  None.
6326  Example:
6327  <code>
6328 #define MY_USART_INSTANCE USART_ID_1
6329  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6330  USART_HANDSHAKE_MODE_SIMPLEX);
6331  </code>
6332  Remarks:
6333  This feature may not be available on all devices. Please refer to the
6334  specific device data sheet to determine availability or use
6335  PLIB_USART_ExistsHandshakeMode in your application to determine
6336  whether this feature is available.
6337 */
6338 
6339 void
6341  USART_MODULE_ID index ,
6342  USART_HANDSHAKE_MODE handshakeConfig ) ;
6343 //******************************************************************************
6344 /* Function:
6345  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6346  int8_t Mask)
6347  Summary:
6348  Setup the automatic Address Detect mode.
6349  Description:
6350  This function configures the automatic Address Detect mode. Uses the mask as
6351  the address character for automatic address detection.
6352  This operation is atomic.
6353  Precondition:
6354  None.
6355  Parameters:
6356  index - Identifier for the device instance to be configured
6357  Mask - Address character to be used, when enabled
6358  Returns:
6359  None.
6360  Example:
6361  <code>
6362 #define MY_USART_INSTANCE USART_ID_1
6363  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6364  MY_DEVICE_ADDRESS);
6365  </code>
6366  Remarks:
6367  This feature may not be available on all devices. Please refer to the
6368  specific device data sheet to determine availability or use
6369  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6370  whether this feature is available.
6371 */
6372 
6373 void
6375  USART_MODULE_ID index ,
6376  int8_t Mask ) ;
6377 //******************************************************************************
6378 /* Function:
6379  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6380  USART_MODULE_ID index )
6381  Summary:
6382  Disables the automatic Address Detect mode.
6383  Description:
6384  This function disables the automatic Address Detect mode.
6385  This operation is atomic.
6386  Precondition:
6387  None.
6388  Parameters:
6389  index - Identifier for the device instance to be configured
6390  Returns:
6391  None.
6392  Example:
6393  <code>
6394 #define MY_USART_INSTANCE USART_ID_1
6395  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6396  </code>
6397  Remarks:
6398  This feature may not be available on all devices. Please refer to the
6399  specific device data sheet to determine availability or use
6400  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6401  whether this feature is available.
6402 */
6403 
6404 void
6406  USART_MODULE_ID index ) ;
6407 //******************************************************************************
6408 /* Function:
6409  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6410  Summary:
6411  Enables the IrDA encoder and decoder.
6412  Description:
6413  This function enables the IrDA encoder and decoder.
6414  This operation is atomic.
6415  Precondition:
6416  None.
6417  Parameters:
6418  index - Identifier for the device instance to be configured
6419  Returns:
6420  None.
6421  Example:
6422  <code>
6423 #define MY_USART_INSTANCE USART_ID_1
6424  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6425  </code>
6426  Remarks:
6427  This feature may not be available on all devices. Please refer to the
6428  specific device data sheet to determine availability or use
6429  PLIB_USART_ExistsIrDA in your application to determine
6430  whether this feature is available.
6431 */
6432 
6433 void
6435  USART_MODULE_ID index ) ;
6436 //******************************************************************************
6437 /* Function:
6438  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6439  Summary:
6440  Disables the IrDA encoder and decoder.
6441  Description:
6442  This function disables the IrDA encoder and decoder.
6443  This operation is atomic.
6444  Precondition:
6445  None.
6446  Parameters:
6447  index - Identifier for the device instance to be configured
6448  Returns:
6449  None.
6450  Example:
6451  <code>
6452 #define MY_USART_INSTANCE USART_ID_1
6453  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6454  </code>
6455  Remarks:
6456  By default, the IrDA Encoder and Decoder are disabled.
6457 
6458  This feature may not be available on all devices. Please refer to the
6459  specific device data sheet to determine availability or use
6460  PLIB_USART_ExistsIrDA in your application to determine
6461  whether this feature is available.
6462 */
6463 
6464 void
6466  USART_MODULE_ID index ) ;
6467 //******************************************************************************
6468 /* Function:
6469  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6470  Summary:
6471  Enables Loopback mode.
6472  Description:
6473  This function enables Loopback mode.
6474  This operation is atomic.
6475  Precondition:
6476  None.
6477  Parameters:
6478  index - Identifier for the device instance to be configured
6479  Returns:
6480  None.
6481  Example:
6482  <code>
6483 #define MY_USART_INSTANCE USART_ID_1
6484  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6485  </code>
6486  Remarks:
6487  By default, Loopback mode is disabled.
6488 
6489  This feature may not be available on all devices. Please refer to the
6490  specific device data sheet to determine availability or use
6491  PLIB_USART_ExistsLoopback in your application to determine
6492  whether this feature is available.
6493 */
6494 
6495 void
6497  USART_MODULE_ID index ) ;
6498 //******************************************************************************
6499 /* Function:
6500  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6501  Summary:
6502  Disables Loopback mode.
6503  Description:
6504  This function disables Loopback mode.
6505  This operation is atomic.
6506  Precondition:
6507  None.
6508  Parameters:
6509  index - Identifier for the device instance to be configured
6510  Returns:
6511  None.
6512  Example:
6513  <code>
6514 #define MY_USART_INSTANCE USART_ID_1
6515  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6516  </code>
6517  Remarks:
6518  By default, Loopback mode is disabled.
6519  This feature may not be available on all devices. Please refer to the
6520  specific device data sheet to determine availability or use
6521  PLIB_USART_ExistsLoopback in your application to determine
6522  whether this feature is available.
6523 */
6524 
6525 void
6527  USART_MODULE_ID index ) ;
6528 //******************************************************************************
6529 /* Function:
6530  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6531  USART_OPERATION_MODE operationmode)
6532  Summary:
6533  Configures the operation mode of the USART module.
6534  Description:
6535  This function configures the operation mode of the USART (i.e., controls the
6536  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6537  possible settings.
6538  Precondition:
6539  None.
6540  Parameters:
6541  index - Identifier for the device instance to be configured
6542  operationmode - One of the possible values from USART_OPERATION_MODE
6543  Returns:
6544  None.
6545  Example:
6546  <code>
6547 #define MY_USART_INSTANCE USART_ID_1
6548  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6549  </code>
6550  Remarks:
6551  This feature may not be available on all devices. Please refer to the
6552  specific device data sheet to determine availability or use
6553  PLIB_USART_ExistsOperationMode in your application to determine
6554  whether this feature is available.
6555 */
6556 
6557 void
6559  USART_MODULE_ID index ,
6560  USART_OPERATION_MODE operationmode ) ;
6561 //******************************************************************************
6562 /* Function:
6563  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6564  Summary:
6565  Discontinues operation when the device enters Idle mode.
6566  Description:
6567  This function enables the USART module to discontinue operation when the
6568  device enters Idle mode.
6569  This operation is atomic.
6570  Precondition:
6571  None.
6572  Parameters:
6573  index - Identifier for the device instance to be configured
6574  Returns:
6575  None.
6576  Example:
6577  <code>
6578 #define MY_USART_INSTANCE USART_ID_1
6579  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6580  </code>
6581  Remarks:
6582  This feature may not be available on all devices. Please refer to the
6583  specific device data sheet to determine availability or use
6584  PLIB_USART_ExistsStopInIdle in your application to determine
6585  whether this feature is available.
6586 */
6587 
6588 void
6590  USART_MODULE_ID index ) ;
6591 //******************************************************************************
6592 /* Function:
6593  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6594  Summary:
6595  Disables the Stop in Idle mode (the USART module continues operation when
6596  the device is in Idle mode).
6597  Description:
6598  This function disables the Stop in Idle mode. The USART module continues
6599  operation when the device is in Idle mode.
6600  This operation is atomic.
6601  Precondition:
6602  None.
6603  Parameters:
6604  index - Identifier for the device instance to be configured
6605  Returns:
6606  None.
6607  Example:
6608  <code>
6609 #define MY_USART_INSTANCE USART_ID_1
6610  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6611  </code>
6612  Remarks:
6613  By default, the USART module will continue operation in Idle mode.
6614 
6615  This feature may not be available on all devices. Please refer to the
6616  specific device data sheet to determine availability or use
6617  PLIB_USART_ExistsStopInIdle in your application to determine
6618  whether this feature is available.
6619 */
6620 
6621 void
6623  USART_MODULE_ID index ) ;
6624 //******************************************************************************
6625 /* Function:
6626  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6627  Summary:
6628  Enables the wake-up on start bit detection feature during Sleep mode.
6629  Description:
6630  This function enables the wake-up on start feature during Sleep mode.
6631  This operation is atomic.
6632  Precondition:
6633  None.
6634  Parameters:
6635  index - Identifier for the device instance to be configured
6636  Returns:
6637  None.
6638  Example:
6639  <code>
6640 #define MY_USART_INSTANCE USART_ID_1
6641  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6642  </code>
6643  Remarks:
6644  This feature may not be available on all devices. Please refer to the
6645  specific device data sheet to determine availability or use
6646  PLIB_USART_ExistsWakeOnStart in your application to determine
6647  whether this feature is available.
6648 */
6649 
6650 void
6652  USART_MODULE_ID index ) ;
6653 //******************************************************************************
6654 /* Function:
6655  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
6656  Summary:
6657  Disables the wake-up on start bit detection feature during Sleep mode.
6658  Description:
6659  This function disables the wake-up on start bit detection feature during
6660  Sleep mode.
6661  This operation is atomic.
6662  Precondition:
6663  None.
6664  Parameters:
6665  index - Identifier for the device instance to be configured
6666  Returns:
6667  None.
6668  Example:
6669  <code>
6670 #define MY_USART_INSTANCE USART_ID_1
6671  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
6672  </code>
6673  Remarks:
6674  This feature may not be available on all devices. Please refer to the
6675  specific device data sheet to determine availability or use
6676  PLIB_USART_ExistsWakeOnStart in your application to determine
6677  whether this feature is available.
6678 */
6679 
6680 void
6682  USART_MODULE_ID index ) ;
6683 //******************************************************************************
6684 /* Function:
6685  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
6686  Summary:
6687  Gets the state of the sync break event completion.
6688  Description:
6689  This function returns the status of the sync break event, when called
6690  after enabling using PLIB_USART_WakeOnStartEnable.
6691  This operation is atomic.
6692  Precondition:
6693  None.
6694  Parameters:
6695  index - Identifier for the device instance to be configured
6696  Returns:
6697  None.
6698  Example:
6699  <code>
6700 #define MY_USART_INSTANCE USART_ID_1
6701  //Call the interface just prior to entering the sleep mode.
6702  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6703  // Check the status if the Sync break event is over.
6704  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
6705  {
6706  // Do Something
6707  }
6708  </code>
6709  Remarks:
6710  This feature may not be available on all devices. Please refer to the
6711  specific device data sheet to determine availability or use
6712  PLIB_USART_ExistsWakeOnStart in your application to determine
6713  whether this feature is available.
6714 */
6715 
6716 bool
6718  USART_MODULE_ID index ) ;
6719 //******************************************************************************
6720 /* Function:
6721  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
6722  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
6723  Summary:
6724  Enables or disables general features of the USART module.
6725  Description:
6726  This function enables or disables general features of the USART module.
6727  Precondition:
6728  None.
6729  Parameters:
6730  index - Identifier for the device instance to be configured
6731  autobaud - If true, auto baud rate detection is enabled. If false
6732  the feature is disabled.
6733  loopBackMode - If true, loop back is enabled. If false the feature is
6734  disabled.
6735  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
6736  mode on USART activity. If false the feature is disabled.
6737  irdaMode - If true, the IrDA mode is enabled. If false the feature
6738  is disabled.
6739  stopInIdle - If true, module will stop functioning when CPU enters Idle
6740  mode. If false, the feature is disabled.
6741  Returns:
6742  None.
6743  Example:
6744  <code>
6745 #define MY_USART_INSTANCE USART_ID_1
6746  // Enable loopback, disable IrDA, disable auto baud detection and disable
6747  // wake from sleep. Enable stop in idle
6748  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
6749  false, false, true);
6750  </code>
6751  Remarks:
6752  Enabling the wake from sleep feature will cause the first character that is
6753  received by the USART module to be discarded. This feature should only be
6754  enabled if the CPU is to placed in power saving mode.
6755 
6756  This feature may not be available on all devices. Please refer to the
6757  specific device data sheet to determine availability. Availability of this
6758  function can also be determined if all of the following functions return
6759  true:
6760  - PLIB_USART_ExistsLoopback
6761  - PLIB_USART_ExistsBaudRateAutoDetect
6762  - PLIB_USART_ExistsWakeOnStart
6763  - PLIB_USART_ExistsIrDA
6764  - PLIB_USART_ExistsStopInIdle
6765 */
6766 
6767 void
6769  USART_MODULE_ID index ,
6770  bool autobaud ,
6771  bool loopBackMode ,
6772  bool wakeFromSleep ,
6773  bool irdaMode ,
6774  bool stopInIdle ) ;
6775 //******************************************************************************
6776 /* Function:
6777  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
6778  USART_RECEIVE_INTR_MODE receiveInterruptMode,
6779  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
6780  USART_OPERATION_MODE operationMode);
6781  Summary:
6782  Configures the Receive and Transmit FIFO interrupt levels and the hardware
6783  lines to be used by the module.
6784  Description:
6785  This function configures the Receive and Transmit FIFO interrupt levels and
6786  the hardware lines to be used by the module.
6787  Precondition:
6788  None.
6789  Parameters:
6790  index - Identifier for the device instance to be configured
6791  receiveInterruptMode - Receiver FIFO interrupt level
6792  transmitInterruptMode - Transmit FIFO interrupt level
6793  operationMode - Hardware lines to be used by the USART.
6794  Returns:
6795  None.
6796  Example:
6797  <code>
6798 #define MY_USART_INSTANCE USART_ID_1
6799  // Set receive FIFO to interrupt when FIFO is 3/4 level full
6800  // Set Transmit FIFO to interrupt when FIFO is empty
6801  // USART module will only use RX and TX hardware lines
6802  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
6803  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
6804  </code>
6805  Remarks:
6806  This feature may not be available on all devices. Please refer to the
6807  specific device data sheet to determine availability. Availability of this
6808  function can also be determined if all of the following functions return
6809  true:
6810  - PLIB_USART_ExistsReceiverInterruptMode
6811  - PLIB_USART_ExistsTransmitterInterruptMode
6812  - PLIB_USART_ExistsOperationMode
6813 */
6814 
6815 void
6817  USART_MODULE_ID index ,
6818  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
6819  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
6820  USART_OPERATION_MODE operationMode ) ;
6821 //******************************************************************************
6822 /* Function:
6823  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
6824  clockFrequency, uint32_t baudRate );
6825  Summary:
6826  Sets the baud rate to the desired value and enables the USART receiver,
6827  transmitter and the USART module.
6828  Description:
6829  This function sets the baud rate to the desired value and enables the USART
6830  receiver, USART transmitter and USART module.
6831  Precondition:
6832  None.
6833  Parameters:
6834  index - Identifier for the device instance to be configured
6835  baudRate - Baud Rate Value
6836  clockFrequency - Clock Frequency
6837  Returns:
6838  None.
6839  Example:
6840  <code>
6841 #define MY_USART_INSTANCE USART_ID_1
6842  uint32_t baudRateValue ;
6843  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
6844  </code>
6845  Remarks:
6846  Setting a new baud rate value causes the baud rate timer to reset.
6847  This ensures that the baud rate timer does not have to overflow before
6848  outputting the new baud rate.
6849 
6850  If the system clock is changed during an active receive operation, a
6851  receiver error or data loss may result. To avoid this issue verify that
6852  no receptions are in progress before changing the system clock.
6853 
6854  This feature may not be available on all devices. Please refer to the
6855  specific device data sheet to determine availability. Availability of this
6856  function can also be determined if all of the following functions return
6857  true:
6858  - PLIB_USART_ExistsBaudRate
6859  - PLIB_USART_ExistsTransmitterEnable
6860  - PLIB_USART_ExistsReceiverEnable
6861  - PLIB_USART_ExistsEnable
6862 */
6863 
6864 void
6866  USART_MODULE_ID index ,
6867  uint32_t systemClock ,
6868  uint32_t baud ) ;
6869 //******************************************************************************
6870 /* Function:
6871  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
6872  Summary:
6873  Return the status of all errors in the specified USART module.
6874  Description:
6875  This function returns status of all errors in the specified USART module.
6876  The return value can be bitwise AND'ed with a USART_ERROR type to know the
6877  status of a specific error.
6878  This operation is atomic.
6879  Precondition:
6880  None.
6881  Parameters:
6882  index - Identifier for the device instance to be configured
6883  Returns:
6884  Returns a bitmap of USART error status.
6885  Example:
6886  <code>
6887 #define MY_USART_INSTANCE USART_ID_1
6888  USART_ERROR error;
6889  // Get the status of all errors.
6890  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
6891  // Check if parity error is active
6892  if(error & USART_ERROR_PARITY)
6893  {
6894  // Parity error is active.
6895  }
6896  else if(error & USART_ERROR_FRAMING)
6897  {
6898  // Framing error is active.
6899  }
6900  </code>
6901  Remarks:
6902  This feature may not be available on all devices. Please refer to the
6903  specific device data sheet to determine availability. Availability of this
6904  function can also be determined if all of the followings functions return
6905  true:
6906  - PLIB_USART_ExistsReceiverFramingErrorStatus
6907  - PLIB_USART_ExistsReceiverParityErrorStatus
6908  - PLIB_USART_ExistsReceiverOverrunStatus
6909 */
6910 
6911 USART_ERROR
6913  USART_MODULE_ID index ) ;
6914 //******************************************************************************
6915 /* Function:
6916  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
6917  Summary:
6918  Returns the address of the USART TX register
6919  Description:
6920  This function returns the address of the USART TX register.
6921  This operation is atomic.
6922  Preconditions:
6923  None.
6924  Parameters:
6925  index - Identifier for the device instance
6926  Returns:
6927  Address of the USART TX register
6928  Remarks:
6929  None.
6930 */
6931 
6932 void *
6934  USART_MODULE_ID index ) ;
6935 //******************************************************************************
6936 /* Function:
6937  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
6938  Summary:
6939  Returns the address of the USART RX register
6940  Description:
6941  This function returns the address of the USART RX register.
6942  This operation is atomic.
6943  Preconditions:
6944  None.
6945  Parameters:
6946  index - Identifier for the device instance
6947  Returns:
6948  Address of the USART RX register
6949  Remarks:
6950  None.
6951 */
6952 
6953 void *
6955  USART_MODULE_ID index ) ;
6956 // *****************************************************************************
6957 // *****************************************************************************
6958 // Section: USART Peripheral Library Exists Functions
6959 // *****************************************************************************
6960 // *****************************************************************************
6961 /* The following functions indicate the existence of the features on the device.
6962 */
6963 //******************************************************************************
6964 /* Function:
6965  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
6966  Summary:
6967  Identifies whether the Run in overflow condition feature exists on the USART module.
6968  Description:
6969  This function identifies whether the Run in Overflow condition feature is
6970  available on the USART module. When this function returns true, these
6971  functions are supported on the device:
6972  - PLIB_USART_RunInOverflowEnable
6973  - PLIB_USART_RunInOverflowDisable
6974  - PLIB_USART_RunInOverflowIsEnabled
6975  This operation is atomic.
6976  Preconditions:
6977  None.
6978  Parameters:
6979  index - Identifier for the device instance
6980  Returns:
6981  - true - The Run in Overflow condition feature is supported on the device
6982  - false - The Run in Overflow condition feature is not supported on the device
6983  Remarks:
6984  None.
6985 */
6986 
6987 bool
6989  USART_MODULE_ID index ) ;
6990 //******************************************************************************
6991 /* Function:
6992  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
6993  Summary:
6994  Identifies whether the BRG Clock source select feature exists on the
6995  USART module.
6996  Description:
6997  This function identifies whether the BRG Clock source select feature is
6998  available on the USART module. When this function returns true, these
6999  functions are supported on the device:
7000  - PLIB_USART_BRGClockSourceSelect
7001  - PLIB_USART_BRGClockSourceGet
7002  This operation is atomic.
7003  Preconditions:
7004  None.
7005  Parameters:
7006  index - Identifier for the device instance
7007  Returns:
7008  - true - The BRG clock source select feature is supported on the device
7009  - false - The BRG clock source select feature is not supported on the device
7010  Remarks:
7011  None.
7012 */
7013 
7014 bool
7016  USART_MODULE_ID index ) ;
7017 //******************************************************************************
7018 /* Function:
7019  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
7020  Summary:
7021  Identifies whether the module running status feature exists on the
7022  USART module.
7023  Description:
7024  This function identifies whether the module running status feature is
7025  available on the USART module. When this function returns true, this
7026  function is supported on the device:
7027  - PLIB_USART_ModuleIsBusy
7028  This operation is atomic.
7029  Preconditions:
7030  None.
7031  Parameters:
7032  index - Identifier for the device instance
7033  Returns:
7034  - true - The Module running status feature is supported on the device
7035  - false - The Module running status feature is not supported on the device
7036  Remarks:
7037  None.
7038 */
7039 
7040 bool
7042  USART_MODULE_ID index ) ;
7043 //******************************************************************************
7044 /* Function:
7045  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
7046  Summary:
7047  Identifies whether the Run in Sleep mode feature exists on the USART module.
7048  Description:
7049  This function identifies whether the Run in Sleep mode feature is
7050  available on the USART module. When this function returns true, these
7051  functions are supported on the device:
7052  - PLIB_USART_RunInSleepModeEnable
7053  - PLIB_USART_RunInSleepModeDisable
7054  - PLIB_USART_RunInSleepModeIsEnabled
7055  This operation is atomic.
7056  Preconditions:
7057  None.
7058  Parameters:
7059  index - Identifier for the device instance
7060  Returns:
7061  - true - The Run in Sleep mode feature is supported on the device
7062  - false - The Run in Sleep mode feature is not supported on the device
7063  Remarks:
7064  None.
7065 */
7066 
7067 bool
7069  USART_MODULE_ID index ) ;
7070 //******************************************************************************
7071 /* Function:
7072  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
7073  Summary:
7074  Identifies whether the EnableControl feature exists on the USART module.
7075  Description:
7076  This function identifies whether the EnableControl feature is
7077  available on the USART module. When this function returns true, these
7078  functions are supported on the device:
7079  - PLIB_USART_Disable
7080  - PLIB_USART_Enable
7081  This operation is atomic.
7082  Preconditions:
7083  None.
7084  Parameters:
7085  index - Identifier for the device instance
7086  Returns:
7087  - true - The EnableControl feature is supported on the device
7088  - false - The EnableControl feature is not supported on the device
7089  Remarks:
7090  None.
7091 */
7092 
7093 bool
7095  USART_MODULE_ID index ) ;
7096 //******************************************************************************
7097 /* Function:
7098  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7099  Summary:
7100  Identifies whether the HandShakeMode feature exists on the USART module.
7101  Description:
7102  This function identifies whether the HandShakeMode feature is
7103  available on the USART module. When this function returns true, this
7104  function is supported on the device:
7105  - PLIB_USART_HandshakeModeSelect
7106  This operation is atomic.
7107  Preconditions:
7108  None.
7109  Parameters:
7110  index - Identifier for the device instance
7111  Returns:
7112  - true - The HandShakeMode feature is supported on the device
7113  - false - The HandShakeMode feature is not supported on the device
7114  Remarks:
7115  None.
7116 */
7117 
7118 bool
7120  USART_MODULE_ID index ) ;
7121 //******************************************************************************
7122 /* Function:
7123  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7124  Summary:
7125  Identifies whether the IrDAControl feature exists on the USART module.
7126  Description:
7127  This function identifies whether the IrDAControl feature is
7128  available on the USART module. When this function returns true, these
7129  functions are supported on the device:
7130  - PLIB_USART_IrDADisable
7131  - PLIB_USART_IrDAEnable
7132  This operation is atomic.
7133  Preconditions:
7134  None.
7135  Parameters:
7136  index - Identifier for the device instance
7137  Returns:
7138  - true - The IrDAControl feature is supported on the device
7139  - false - The IrDAControl feature is not supported on the device
7140  Remarks:
7141  None.
7142 */
7143 
7144 bool
7146  USART_MODULE_ID index ) ;
7147 //******************************************************************************
7148 /* Function:
7149  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7150  Summary:
7151  Identifies whether the LineControlMode feature exists on the USART module.
7152  Description:
7153  This function identifies whether the LineControlMode feature is
7154  available on the USART module. When this function returns true, this
7155  function is supported on the device:
7156  - PLIB_USART_LineControlModeSelect
7157  This operation is atomic.
7158  Preconditions:
7159  None.
7160  Parameters:
7161  index - Identifier for the device instance
7162  Returns:
7163  - true - The LineControlMode feature is supported on the device
7164  - false - The LineControlMode feature is not supported on the device
7165  Remarks:
7166  None.
7167 */
7168 
7169 bool
7171  USART_MODULE_ID index ) ;
7172 //******************************************************************************
7173 /* Function:
7174  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7175  Summary:
7176  Identifies whether the Loopback feature exists on the USART module.
7177  Description:
7178  This function identifies whether the Loopback feature is
7179  available on the USART module. When this function returns true, these
7180  functions are supported on the device:
7181  - PLIB_USART_LoopbackEnable
7182  - PLIB_USART_LoopbackDisable
7183  This operation is atomic.
7184  Preconditions:
7185  None.
7186  Parameters:
7187  index - Identifier for the device instance
7188  Returns:
7189  - true - The Loopback feature is supported on the device
7190  - false - The Loopback feature is not supported on the device
7191  Remarks:
7192  None.
7193 */
7194 
7195 bool
7197  USART_MODULE_ID index ) ;
7198 //******************************************************************************
7199 /* Function:
7200  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7201  Summary:
7202  Identifies whether the OperationMode feature exists on the USART module.
7203  Description:
7204  This function identifies whether the OperationMode feature is
7205  available on the USART module. When this function returns true, this
7206  function is supported on the device:
7207  - PLIB_USART_OperationModeSelect
7208  This operation is atomic.
7209  Preconditions:
7210  None.
7211  Parameters:
7212  index - Identifier for the device instance
7213  Returns:
7214  - true - The OperationMode feature is supported on the device
7215  - false - The OperationMode feature is not supported on the device
7216  Remarks:
7217  None.
7218 */
7219 
7220 bool
7222  USART_MODULE_ID index ) ;
7223 //******************************************************************************
7224 /* Function:
7225  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7226  Summary:
7227  Identifies whether the StopInIdle feature exists on the USART module.
7228  Description:
7229  This function identifies whether the StopInIdle feature is
7230  available on the USART module. When this function returns true, these
7231  functions are supported on the device:
7232  - PLIB_USART_StopInIdleEnable
7233  - PLIB_USART_StopInIdleDisable
7234  This operation is atomic.
7235  Preconditions:
7236  None.
7237  Parameters:
7238  index - Identifier for the device instance
7239  Returns:
7240  - true - The StopInIdle feature is supported on the device
7241  - false - The StopInIdle feature is not supported on the device
7242  Remarks:
7243  None.
7244 */
7245 
7246 bool
7248  USART_MODULE_ID index ) ;
7249 //******************************************************************************
7250 /* Function:
7251  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7252  Summary:
7253  Identifies whether the WakeOnStart feature exists on the USART module.
7254  Description:
7255  This function identifies whether the WakeOnStart feature is
7256  available on the USART module. When this function returns true, these
7257  functions are supported on the device:
7258  - PLIB_USART_WakeOnStartEnable
7259  - PLIB_USART_WakeOnStartDisable
7260  - PLIB_USART_WakeOnStartIsEnabled
7261  This operation is atomic.
7262  Preconditions:
7263  None.
7264  Parameters:
7265  index - Identifier for the device instance
7266  Returns:
7267  - true - The WakeOnStart feature is supported on the device
7268  - false - The WakeOnStart feature is not supported on the device
7269  Remarks:
7270  None.
7271 */
7272 
7273 bool
7275  USART_MODULE_ID index ) ;
7276 //******************************************************************************
7277 /* Function:
7278  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7279  Summary:
7280  Identifies whether the BaudRate feature exists on the USART module.
7281  Description:
7282  This function identifies whether the BaudRate feature is
7283  available on the USART module. When this function returns true, these
7284  functions are supported on the device:
7285  - PLIB_USART_BaudRateSet
7286  - PLIB_USART_BaudRateGet
7287  This operation is atomic.
7288  Preconditions:
7289  None.
7290  Parameters:
7291  index - Identifier for the device instance
7292  Returns:
7293  - true - The BaudRate feature is supported on the device
7294  - false - The BaudRate feature is not supported on the device
7295  Remarks:
7296  None.
7297 */
7298 
7299 bool
7301  USART_MODULE_ID index ) ;
7302 //******************************************************************************
7303 /* Function:
7304  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7305  Summary:
7306  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7307  Description:
7308  This function identifies whether the BaudRateAutoDetect feature is
7309  available on the USART module. When this function returns true, these
7310  functions are supported on the device:
7311  - PLIB_USART_BaudRateAutoDetectEnable
7312  - PLIB_USART_BaudRateAutoDetectIsComplete
7313  This operation is atomic.
7314  Preconditions:
7315  None.
7316  Parameters:
7317  index - Identifier for the device instance
7318  Returns:
7319  - true - The BaudRateAutoDetect feature is supported on the device
7320  - false - The BaudRateAutoDetect feature is not supported on the device
7321  Remarks:
7322  None.
7323 */
7324 
7325 bool
7327  USART_MODULE_ID index ) ;
7328 //******************************************************************************
7329 /* Function:
7330  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7331  Summary:
7332  Identifies whether the BaudRateHigh feature exists on the USART module.
7333  Description:
7334  This function identifies whether the BaudRateHigh feature is
7335  available on the USART module. When this function returns true, these
7336  functions are supported on the device:
7337  - PLIB_USART_BaudRateHighSet
7338  - PLIB_USART_BaudRateHighDisable
7339  - PLIB_USART_BaudRateHighEnable
7340  This operation is atomic.
7341  Preconditions:
7342  None.
7343  Parameters:
7344  index - Identifier for the device instance
7345  Returns:
7346  - true - The BaudRateHigh feature is supported on the device
7347  - false - The BaudRateHigh feature is not supported on the device
7348  Remarks:
7349  None.
7350 */
7351 
7352 bool
7354  USART_MODULE_ID index ) ;
7355 //******************************************************************************
7356 /* Function:
7357  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7358  Summary:
7359  Identifies whether the Receiver Address feature exists on the USART
7360  module.
7361  Description:
7362  This function identifies whether the Receiver Address feature is
7363  available on the USART module. When this function returns true, these
7364  functions are supported on the device:
7365  - PLIB_USART_AddressSet
7366  - PLIB_USART_AddressGet
7367  This operation is atomic.
7368  Preconditions:
7369  None.
7370  Parameters:
7371  index - Identifier for the device instance
7372  Returns:
7373  - true - The Receiver address feature is supported on the device
7374  - false - The Receiver address feature is not supported on the device
7375  Remarks:
7376  None.
7377 */
7378 
7379 bool
7381  USART_MODULE_ID index ) ;
7382 //******************************************************************************
7383 /* Function:
7384  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7385  Summary:
7386  Identifies whether the Receiver Address Mask feature exists on the USART
7387  module.
7388  Description:
7389  This function identifies whether the Receiver Address Mask feature is
7390  available on the USART module. When this function returns true, these
7391  functions are supported on the device:
7392  - PLIB_USART_AddressMaskSet
7393  - PLIB_USART_AddressMaskGet
7394  This operation is atomic.
7395  Preconditions:
7396  None.
7397  Parameters:
7398  index - Identifier for the device instance
7399  Returns:
7400  - true - The Receiver address mask feature is supported on the device
7401  - false - The Receiver address mask feature is not supported on the device
7402  Remarks:
7403  None.
7404 */
7405 
7406 bool
7408  USART_MODULE_ID index ) ;
7409 //******************************************************************************
7410 /* Function:
7411  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7412  Summary:
7413  Identifies whether the Receiver feature exists on the USART module.
7414  Description:
7415  This function identifies whether the Receiver feature is available on the
7416  USART module. When this function returns true, these functions are supported
7417  on the device:
7418  - PLIB_USART_ReceiverByteReceive
7419  - PLIB_USART_ReceiverAddressGet
7420  This operation is atomic.
7421  Preconditions:
7422  None.
7423  Parameters:
7424  index - Identifier for the device instance
7425  Returns:
7426  - true - The Receiver feature is supported on the device
7427  - false - The Receiver feature is not supported on the device
7428  Remarks:
7429  None.
7430 */
7431 
7432 bool
7434  USART_MODULE_ID index ) ;
7435 //******************************************************************************
7436 /* Function:
7437  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7438  Summary:
7439  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7440  Description:
7441  This function identifies whether the 9 Bits Receiver feature is available on the
7442  USART module. When this function returns true, this function is supported
7443  on the device:
7444  - PLIB_USART_Receiver9BitsReceive
7445  This operation is atomic.
7446  Preconditions:
7447  None.
7448  Parameters:
7449  index - Identifier for the device instance
7450  Returns:
7451  - true - The feature is supported on the device
7452  - false - The feature is not supported on the device
7453  Remarks:
7454  None.
7455 */
7456 
7457 bool
7459  USART_MODULE_ID index ) ;
7460 //******************************************************************************
7461 /* Function:
7462  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7463  Summary:
7464  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7465  Description:
7466  This function identifies whether the ReceiverAddressAutoDetect feature is
7467  available on the USART module. When this function returns true, these
7468  functions are supported on the device:
7469  - PLIB_USART_ReceiverAddressAutoDetectEnable
7470  - PLIB_USART_ReceiverAddressAutoDetectDisable
7471  This operation is atomic.
7472  Preconditions:
7473  None.
7474  Parameters:
7475  index - Identifier for the device instance
7476  Returns:
7477  - true - The ReceiverAddressAutoDetect feature is supported on the device
7478  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7479  Remarks:
7480  None.
7481 */
7482 
7483 bool
7485  USART_MODULE_ID index ) ;
7486 //******************************************************************************
7487 /* Function:
7488  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7489  Summary:
7490  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7491  Description:
7492  This function identifies whether the ReceiverAddressDetect feature is
7493  available on the USART module. When this function returns true, these
7494  functions are supported on the device:
7495  - PLIB_USART_ReceiverAddressDetectEnable
7496  - PLIB_USART_ReceiverAddressDetectDisable
7497  - PLIB_USART_ReceiverAddressIsReceived
7498  This operation is atomic.
7499  Preconditions:
7500  None.
7501  Parameters:
7502  index - Identifier for the device instance
7503  Returns:
7504  - true - The ReceiverAddressDetect feature is supported on the device
7505  - false - The ReceiverAddressDetect feature is not supported on the device
7506  Remarks:
7507  None.
7508 */
7509 
7510 bool
7512  USART_MODULE_ID index ) ;
7513 //******************************************************************************
7514 /* Function:
7515  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7516  Summary:
7517  Identifies whether the ReceiverDataAvailable feature exists on the USART
7518  module
7519  Description:
7520  This function identifies whether the ReceiverDataAvailable feature is
7521  available on the USART module. When this function returns true, this
7522  function is supported on the device:
7523  - PLIB_USART_ReceiverDataIsAvailable
7524  This operation is atomic.
7525  Preconditions:
7526  None.
7527  Parameters:
7528  index - Identifier for the device instance
7529  Returns:
7530  - true - The ReceiverDataAvailable feature is supported on the device
7531  - false - The ReceiverDataAvailable feature is not supported on the device
7532  Remarks:
7533  None.
7534 */
7535 
7536 bool
7538  USART_MODULE_ID index ) ;
7539 //******************************************************************************
7540 /* Function:
7541  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7542  Summary:
7543  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7544  Description:
7545  This function identifies whether the ReceiverEnableControl feature is
7546  available on the USART module. When this function returns true, these
7547  functions are supported on the device:
7548  - PLIB_USART_ReceiverEnable
7549  - PLIB_USART_ReceiverDisable
7550  This operation is atomic.
7551  Preconditions:
7552  None.
7553  Parameters:
7554  index - Identifier for the device instance
7555  Returns:
7556  - true - The ReceiverEnableControl feature is supported on the device
7557  - false - The ReceiverEnableControl feature is not supported on the device
7558  Remarks:
7559  None.
7560 */
7561 
7562 bool
7564  USART_MODULE_ID index ) ;
7565 //******************************************************************************
7566 /* Function:
7567  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7568  Summary:
7569  Identifies whether the ReceiverIdle feature exists on the USART module.
7570  Description:
7571  This function identifies whether the ReceiverIdle feature is
7572  available on the USART module. When this function returns true, this
7573  function is supported on the device:
7574  - PLIB_USART_ReceiverIsIdle
7575  This operation is atomic.
7576  Preconditions:
7577  None.
7578  Parameters:
7579  index - Identifier for the device instance
7580  Returns:
7581  - true - The ReceiverIdle feature is supported on the device
7582  - false - The ReceiverIdle feature is not supported on the device
7583  Remarks:
7584  None.
7585 */
7586 
7587 bool
7589  USART_MODULE_ID index ) ;
7590 //******************************************************************************
7591 /* Function:
7592  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7593  Summary:
7594  Identifies whether the ReceiverFramingError feature exists on the USART module.
7595  Description:
7596  This function identifies whether the ReceiverFramingError feature is
7597  available on the USART module. When this function returns true, this
7598  function is supported on the device:
7599  - PLIB_USART_ReceiverFramingErrorHasOccurred
7600  This operation is atomic.
7601  Preconditions:
7602  None.
7603  Parameters:
7604  index - Identifier for the device instance
7605  Returns:
7606  - true - The ReceiverFramingError feature is supported on the device
7607  - false - The ReceiverFramingError feature is not supported on the device
7608  Remarks:
7609  None.
7610 */
7611 
7612 bool
7614  USART_MODULE_ID index ) ;
7615 //******************************************************************************
7616 /* Function:
7617  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7618  Summary:
7619  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7620  Description:
7621  This function identifies whether the ReceiverInterruptMode feature is
7622  available on the USART module. When this function returns true, this
7623  function is supported on the device:
7624  - PLIB_USART_ReceiverInterruptModeSelect
7625  This operation is atomic.
7626  Preconditions:
7627  None.
7628  Parameters:
7629  index - Identifier for the device instance
7630  Returns:
7631  - true - The ReceiverInterruptMode feature is supported on the device
7632  - false - The ReceiverInterruptMode feature is not supported on the device
7633  Remarks:
7634  None.
7635 */
7636 
7637 bool
7639  USART_MODULE_ID index ) ;
7640 //******************************************************************************
7641 /* Function:
7642  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
7643  Summary:
7644  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
7645  Description:
7646  This function identifies whether the ReceiverPolarityInvert feature is
7647  available on the USART module. When this function returns true, these
7648  functions are supported on the device:
7649  - PLIB_USART_ReceiverIdleStateLowEnable
7650  - PLIB_USART_ReceiverIdleStateLowDisable
7651  This operation is atomic.
7652  Preconditions:
7653  None.
7654  Parameters:
7655  index - Identifier for the device instance
7656  Returns:
7657  - true - The ReceiverPolarityInvert feature is supported on the device
7658  - false - The ReceiverPolarityInvert feature is not supported on the device
7659  Remarks:
7660  None.
7661 */
7662 
7663 bool
7665  USART_MODULE_ID index ) ;
7666 //******************************************************************************
7667 /* Function:
7668  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
7669  Summary:
7670  Identifies whether the ReceiverParityError feature exists on the USART module.
7671  Description:
7672  This function identifies whether the ReceiverParityError feature is
7673  available on the USART module. When this function returns true, this
7674  function is supported on the device:
7675  - PLIB_USART_ReceiverParityErrorHasOccurred
7676  This operation is atomic.
7677  Preconditions:
7678  None.
7679  Parameters:
7680  index - Identifier for the device instance
7681  Returns:
7682  - true - The ReceiverParityError feature is supported on the device
7683  - false - The ReceiverParityError feature is not supported on the device
7684  Remarks:
7685  None.
7686 */
7687 
7688 bool
7690  USART_MODULE_ID index ) ;
7691 //******************************************************************************
7692 /* Function:
7693  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
7694  Summary:
7695  Identifies whether the ReceiverOverrunError feature exists on the USART module.
7696  Description:
7697  This function identifies whether the ReceiverOverrunError feature is
7698  available on the USART module. When this function returns true, these
7699  functions are supported on the device:
7700  - PLIB_USART_ReceiverOverrunErrorClear
7701  - PLIB_USART_ReceiverOverrunHasOccurred
7702  This operation is atomic.
7703  Preconditions:
7704  None.
7705  Parameters:
7706  index - Identifier for the device instance
7707  Returns:
7708  - true - The ReceiverOverrunError feature is supported on the device
7709  - false - The ReceiverOverrunError feature is not supported on the device
7710  Remarks:
7711  None.
7712 */
7713 
7714 bool
7716  USART_MODULE_ID index ) ;
7717 //******************************************************************************
7718 /* Function:
7719  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
7720  Summary:
7721  Identifies whether the Transmitter feature exists on the USART module.
7722  Description:
7723  This function identifies whether the Transmitter feature is
7724  available on the USART module. When this function returns true, these
7725  functions are supported on the device:
7726  - PLIB_USART_TransmitterByteSend
7727  - PLIB_USART_TransmitterAddressGet
7728  This operation is atomic.
7729  Preconditions:
7730  None.
7731  Parameters:
7732  index - Identifier for the device instance
7733  Returns:
7734  - true - The Transmitter feature is supported on the device
7735  - false - The Transmitter feature is not supported on the device
7736  Remarks:
7737  None.
7738 */
7739 
7740 bool
7742  USART_MODULE_ID index ) ;
7743 //******************************************************************************
7744 /* Function:
7745  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
7746  Summary:
7747  Identifies whether the Transmitter9Bits feature exists on the USART module.
7748  Description:
7749  This function identifies whether the Transmitter9Bits feature is
7750  available on the USART module. When this function returns true, this
7751  function is supported on the device:
7752  - PLIB_USART_Transmitter9BitsSend
7753  This operation is atomic.
7754  Preconditions:
7755  None.
7756  Parameters:
7757  index - Identifier for the device instance
7758  Returns:
7759  - true - The Transmitter9Bits feature is supported on the device
7760  - false - The Transmitter9Bits feature is not supported on the device
7761  Remarks:
7762  None.
7763 */
7764 
7765 bool
7767  USART_MODULE_ID index ) ;
7768 //******************************************************************************
7769 /* Function:
7770  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
7771  Summary:
7772  Identifies whether the TransmitterBreak feature exists on the USART module.
7773  Description:
7774  This function identifies whether the TransmitterBreak feature is
7775  available on the USART module. When this function returns true, these
7776  functions are supported on the device:
7777  - PLIB_USART_TransmitterBreakSend
7778  - PLIB_USART_TransmitterBreakSendIsComplete
7779  This operation is atomic.
7780  Preconditions:
7781  None.
7782  Parameters:
7783  index - Identifier for the device instance
7784  Returns:
7785  - true - The TransmitterBreak feature is supported on the device
7786  - false - The TransmitterBreak feature is not supported on the device
7787  Remarks:
7788  None.
7789 */
7790 
7791 bool
7793  USART_MODULE_ID index ) ;
7794 //******************************************************************************
7795 /* Function:
7796  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
7797  Summary:
7798  Identifies whether the TransmitterBufferFull feature exists on the USART module.
7799  Description:
7800  This function identifies whether the TransmitterBufferFull feature is
7801  available on the USART module. When this function returns true, this
7802  function is supported on the device:
7803  - PLIB_USART_TransmitterBufferIsFull
7804  This operation is atomic.
7805  Preconditions:
7806  None.
7807  Parameters:
7808  index - Identifier for the device instance
7809  Returns:
7810  - true - The TransmitterBufferFull feature is supported on the device
7811  - false - The TransmitterBufferFull feature is not supported on the device
7812  Remarks:
7813  None.
7814 */
7815 
7816 bool
7818  USART_MODULE_ID index ) ;
7819 //******************************************************************************
7820 /* Function:
7821  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
7822  Summary:
7823  Identifies whether the TransmitterEmpty feature exists on the USART module.
7824  Description:
7825  This function identifies whether the TransmitterEmpty feature is
7826  available on the USART module. When this function returns true, this
7827  function is supported on the device:
7828  - PLIB_USART_TransmitterIsEmpty
7829  This operation is atomic.
7830  Preconditions:
7831  None.
7832  Parameters:
7833  index - Identifier for the device instance
7834  Returns:
7835  - true - The TransmitterEmpty feature is supported on the device
7836  - false - The TransmitterEmpty feature is not supported on the device
7837  Remarks:
7838  None.
7839 */
7840 
7841 bool
7843  USART_MODULE_ID index ) ;
7844 //******************************************************************************
7845 /* Function:
7846  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
7847  Summary:
7848  Identifies whether the TransmitterEnableControl feature exists on the USART
7849  module
7850  Description:
7851  This function identifies whether the TransmitterEnableControl feature is
7852  available on the USART module. When this function returns true, these
7853  functions are supported on the device:
7854  - PLIB_USART_TransmitterEnable
7855  - PLIB_USART_TransmitterDisable
7856  This operation is atomic.
7857  Preconditions:
7858  None.
7859  Parameters:
7860  index - Identifier for the device instance
7861  Returns:
7862  - true - The TransmitterEnableControl feature is supported on the device
7863  - false - The TransmitterEnableControl feature is not supported on the device
7864  Remarks:
7865  None.
7866 */
7867 
7868 bool
7870  USART_MODULE_ID index ) ;
7871 //******************************************************************************
7872 /* Function:
7873  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
7874  Summary:
7875  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
7876  Description:
7877  This function identifies whether the TransmitterInterruptMode feature is
7878  available on the USART module. When this function returns true, this function
7879  is supported on the device:
7880  - PLIB_USART_TransmitterInterruptModeSelect
7881  This operation is atomic.
7882  Preconditions:
7883  None.
7884  Parameters:
7885  index - Identifier for the device instance
7886  Returns:
7887  - true - The TransmitterInterruptMode feature is supported on the device
7888  - false - The TransmitterInterruptMode feature is not supported on the device
7889  Remarks:
7890  None.
7891 */
7892 
7893 bool
7895  USART_MODULE_ID index ) ;
7896 //******************************************************************************
7897 /* Function:
7898  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
7899  Summary:
7900  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
7901  Description:
7902  This function identifies whether the TransmitterIdleIsLow feature is available
7903  on the USART module. When this function returns true, these functions are
7904  supported on the device:
7905  - PLIB_USART_TransmitterIdleIsLowDisable
7906  - PLIB_USART_TransmitterIdleIsLowEnable
7907  This operation is atomic.
7908  Preconditions:
7909  None.
7910  Parameters:
7911  index - Identifier for the device instance
7912  Returns:
7913  - true - The TransmitterIdleIsLow feature is supported on the device
7914  - false - The TransmitterIdleIsLow feature is not supported on the device
7915  Remarks:
7916  None.
7917 */
7918 
7919 bool
7921  USART_MODULE_ID index ) ;
7922 //DOM-IGNORE-BEGIN
7923 //DOM-IGNORE-END
7924  // #ifndef _PLIB_USART_H
7925 /******************************************************************************
7926  End of File
7927 */
7928 
7929 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
7930 /* CLOSE_FILE Include File */
7931 
7932 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
7933 /*******************************************************************************
7934  System Services Library Interface Header
7935  Company:
7936  Microchip Technology Inc.
7937  File Name:
7938  system.h
7939  Summary:
7940  Top level common system services library interface header.
7941  Description:
7942  This file is the top level common system services library interface header.
7943  It defines (or includes files that define) the common system service
7944  types, prototypes, and other definitions that are commonly used by MPLAB
7945  Harmony libraries and system services.
7946 
7947  System services provide common functionality that would otherwise need to
7948  be duplicated by multiple other modules or that would force them to
7949  interact in complex and hard to manage ways. System services eliminate
7950  conflicts by controlling access shared resources.
7951  Remarks:
7952  The parent directory to the "system" directory should be added to the
7953  compiler's search path for header files such that the following include
7954  statment will successfully include this file.
7955 
7956 #include "system/system.h"
7957  *******************************************************************************/
7958 //DOM-IGNORE-BEGIN
7959 /*******************************************************************************
7960 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
7961 Microchip licenses to you the right to use, modify, copy and distribute
7962 Software only when embedded on a Microchip microcontroller or digital signal
7963 controller that is integrated into your product or third party product
7964 (pursuant to the sublicense terms in the accompanying license agreement).
7965 You should refer to the license agreement accompanying this Software for
7966 additional information regarding your rights and obligations.
7967 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
7968 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7969 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7970 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7971 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7972 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7973 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7974 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7975 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7976 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7977  *******************************************************************************/
7978 //DOM-IGNORE-END
7979 #ifndef _SYSTEM_H
7980 #define _SYSTEM_H
7981 // *****************************************************************************
7982 // *****************************************************************************
7983 // Section: Included Files
7984 // *****************************************************************************
7985 // *****************************************************************************
7986 #include "system/common/sys_common.h"
7987 #include "system/common/sys_module.h"
7988 // DOM-IGNORE-BEGIN
7989 // DOM-IGNORE-END
7990 //DOM-IGNORE-BEGIN
7991 //DOM-IGNORE-END
7992  // _SYSTEM_H
7993 /*******************************************************************************
7994  End of File
7995 */
7996 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
7997 /* CLOSE_FILE Include File */
7998 
7999 #include "system/int/sys_int.h"
8000 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
8001 /*******************************************************************************
8002  DMA System Service Library Interface Definition
8003  Company:
8004  Microchip Technology Inc.
8005  File Name:
8006  sys_dma.h
8007  Summary:
8008  DMA System Service.
8009  Description:
8010  This file contains the interface definition for the DMA System
8011  Service. It provides a way to interact with the DMA subsystem to
8012  manage the data transfer between different peripherals and/or memory
8013  without intervention from the CPU.
8014 *******************************************************************************/
8015 //DOM-IGNORE-BEGIN
8016 /*******************************************************************************
8017 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
8018 Microchip licenses to you the right to use, modify, copy and distribute
8019 Software only when embedded on a Microchip microcontroller or digital signal
8020 controller that is integrated into your product or third party product
8021 (pursuant to the sublicense terms in the accompanying license agreement).
8022 You should refer to the license agreement accompanying this Software for
8023 additional information regarding your rights and obligations.
8024 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8025 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8026 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8027 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8028 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8029 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8030 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8031 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8032 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8033 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8034 *******************************************************************************/
8035 //DOM-IGNORE-END
8036 #ifndef _SYS_DMA_H
8037 #define _SYS_DMA_H
8038 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
8039 /*******************************************************************************
8040  DMA System Service Library Interface Definition
8041  Company:
8042  Microchip Technology Inc.
8043  File Name:
8044  sys_dma_definitions.h
8045  Summary:
8046  DMA System Service data type definitions header.
8047  Description:
8048  This file contains data type definitions header.
8049 *******************************************************************************/
8050 //DOM-IGNORE-BEGIN
8051 /*******************************************************************************
8052 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
8053 Microchip licenses to you the right to use, modify, copy and distribute
8054 Software only when embedded on a Microchip microcontroller or digital signal
8055 controller that is integrated into your product or third party product
8056 (pursuant to the sublicense terms in the accompanying license agreement).
8057 You should refer to the license agreement accompanying this Software for
8058 additional information regarding your rights and obligations.
8059 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8060 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8061 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8062 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8063 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8064 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8065 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8066 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8067 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8068 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8069 *******************************************************************************/
8070 //DOM-IGNORE-END
8071 #ifndef _SYS_DMA_DEFINITIONS_H
8072 #define _SYS_DMA_DEFINITIONS_H
8073 // *****************************************************************************
8074 // *****************************************************************************
8075 // Section: File includes
8076 // *****************************************************************************
8077 // *****************************************************************************
8078 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
8079 #include "system/common/sys_common.h"
8080 #include "system/common/sys_module.h"
8081 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
8082 /*******************************************************************************
8083  DMA Peripheral Library Interface Header
8084  Company:
8085  Microchip Technology Inc.
8086  File Name:
8087  plib_dma.h
8088  Summary:
8089  Defines the DMA Peripheral Library interface functions.
8090  Description:
8091  This header file contains the function prototypes and definitions of
8092  the data types and constants that make up the interface to the Direct Memory
8093  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8094  definitions in this file are for the DMA module.
8095 *******************************************************************************/
8096 // DOM-IGNORE-BEGIN
8097 /*******************************************************************************
8098 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8099 Microchip licenses to you the right to use, modify, copy and distribute
8100 Software only when embedded on a Microchip microcontroller or digital signal
8101 controller that is integrated into your product or third party product
8102 (pursuant to the sublicense terms in the accompanying license agreement).
8103 You should refer to the license agreement accompanying this Software for
8104 additional information regarding your rights and obligations.
8105 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8106 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8107 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8108 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8109 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8110 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8111 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8112 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8113 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8114 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8115 *******************************************************************************/
8116 // DOM-IGNORE-END
8117 #ifndef _PLIB_DMA_H
8118 #define _PLIB_DMA_H
8119 // DOM-IGNORE-BEGIN
8120 // DOM-IGNORE-END
8121 // *****************************************************************************
8122 // *****************************************************************************
8123 // Section: Includes
8124 // *****************************************************************************
8125 // *****************************************************************************
8126 /* See Bottom of file for implementation header include files.
8127 */
8128 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8129 //DOM-IGNORE-BEGIN
8130 /*******************************************************************************
8131 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8132 Microchip licenses to you the right to use, modify, copy and distribute
8133 Software only when embedded on a Microchip microcontroller or digital signal
8134 controller that is integrated into your product or third party product
8135 (pursuant to the sublicense terms in the accompanying license agreement).
8136 You should refer to the license agreement accompanying this Software for
8137 additional information regarding your rights and obligations.
8138 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8139 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8140 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8141 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8142 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8143 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8144 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8145 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8146 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8147 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8148  *******************************************************************************/
8149 //DOM-IGNORE-END
8150 #ifndef _PLIB_DMA_PROCESSOR_H
8151 #define _PLIB_DMA_PROCESSOR_H
8152 #error "Can't find header"
8153 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8154 /* CLOSE_FILE Include File */
8155 
8156 // *****************************************************************************
8157 // *****************************************************************************
8158 // Section: Peripheral Library Interface Functions
8159 // *****************************************************************************
8160 // *****************************************************************************
8161 // *****************************************************************************
8162 // *****************************************************************************
8163 // Section: DMA Channel Status Functions
8164 // *****************************************************************************
8165 // *****************************************************************************
8166 //******************************************************************************
8167 /* Function:
8168  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8169  DMA_CHANNEL channel )
8170  Summary:
8171  Returns the buffered data write status for the specified channel.
8172  Description:
8173  This function returns the buffered data write status for the specified channel.
8174  Precondition:
8175  None.
8176  Parameters:
8177  channel - One of the existing DMA channels listed by DMA_CHANNEL
8178  Returns:
8179  - true - The content of the DMA buffer has not been written to the location
8180  specified in the destination/source address or in Null Write mode
8181  - false - The content of the DMA buffer has been written to the location
8182  specified in the destination/source address or in Null Write mode
8183  Example:
8184  <code>
8185  bool chBuffWriteStatus;
8186  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8187  DMA_CHANNEL_3 );
8188  </code>
8189  Remarks:
8190  This feature is not available on all devices. Please refer to the specific device
8191  data sheet to determine availability.
8192 */
8193 
8194 bool
8196  DMA_MODULE_ID index ,
8197  DMA_CHANNEL channel ) ;
8198 /*******************************************************************************
8199  Function:
8200  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8201  DMA_CHANNEL channel,
8202  DMA_CHANNEL_COLLISION collisonType )
8203  Summary:
8204  Returns the status of the specified collision type for the specified channel.
8205  Description:
8206  This function returns the status of the specified collision type for the
8207  specified channel.
8208  Precondition:
8209  None.
8210  Parameters:
8211  channel - One of the existing DMA channels listed by DMA_CHANNEL
8212  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8213  Returns:
8214  - true - A collision specified by collisonType was detected
8215  - false - No collision of type collisonType was detected
8216  Example:
8217  <code>
8218  bool memWriteCollisionStatus;
8219  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8220  DMA_ID_0,
8221  DMA_CHANNEL_3,
8222  DMA_CHANNEL_COLLISION_MEMORY );
8223  </code>
8224  Remarks:
8225  This feature is not available on all devices. Please refer to the specific
8226  device data sheet to determine availability.
8227 */
8228 
8229 bool
8231  DMA_MODULE_ID index ,
8232  DMA_CHANNEL channel ,
8233  DMA_CHANNEL_COLLISION collisonType ) ;
8234 //******************************************************************************
8235 /* Function:
8236  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8237  DMA_CHANNEL channel )
8238  Summary:
8239  Returns the Ping-Pong mode status for the specified channel.
8240  Description:
8241  This function returns the Ping-Pong mode status for the specified channel.
8242  Precondition:
8243  None.
8244  Parameters:
8245  channel - One of the existing DMA channels listed by DMA_CHANNEL
8246  Returns:
8247  mode - One of the possible Ping-Pong modes
8248  Example:
8249  <code>
8250  DMA_PING_PONG_MODE chPingPongStatus;
8251  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8252  DMA_CHANNEL_3 );
8253  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8254  {
8255  \\Application
8256  }
8257  </code>
8258  Remarks:
8259  This feature is not available on all devices. Please refer to the specific
8260  device data sheet to determine availability.
8261 */
8262 
8263 DMA_PING_PONG_MODE
8265  DMA_MODULE_ID index ,
8266  DMA_CHANNEL channel ) ;
8267 //******************************************************************************
8268 /* Function:
8269  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8270  DMA_CHANNEL channel )
8271  Summary:
8272  Returns the event status on the specified channel.
8273  Description:
8274  This function returns the event status on the specified channel.
8275  Precondition:
8276  None.
8277  Parameters:
8278  channel - One of the possible DMA channels listed by DMA_CHANNEL
8279  Returns:
8280  - true - An event was detected
8281  - false - No events were detected
8282  Example:
8283  <code>
8284  bool channeleventStatus;
8285  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8286  DMA_CHANNEL_2 );
8287  </code>
8288  Remarks:
8289  This function implements an operation of the ChannelXEvent feature.
8290  This feature may not be available on all devices. Please refer to the
8291  specific device data sheet to determine availability or include the
8292  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8293  whether this feature is available.
8294 */
8295 
8296 bool
8298  DMA_MODULE_ID index ,
8299  DMA_CHANNEL channel ) ;
8300 // *****************************************************************************
8301 // *****************************************************************************
8302 // Section: DMA Channel Configuration Functions
8303 // *****************************************************************************
8304 // *****************************************************************************
8305 //******************************************************************************
8306 /* Function:
8307  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8308  DMA_CHANNEL channel,
8309  DMA_CHANNEL_PRIORITY channelPriority )
8310  Summary:
8311  Sets the priority of the specified channel.
8312  Description:
8313  This function sets the priority of the specified channel.
8314  Precondition:
8315  None.
8316  Parameters:
8317  channel - One of the existing DMA channels listed by DMA_CHANNEL
8318  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8319  Returns:
8320  None.
8321  Example:
8322  <code>
8323  DMA_CHANNEL channel = DMA_CHANNEL_0;
8324  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8325  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8326  </code>
8327  Remarks:
8328  This function implements an operation of the ChannelXPriority feature.
8329  This feature may not be available on all devices. Please refer to the
8330  specific device data sheet to determine availability or use the
8331  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8332  whether this feature is available.
8333 */
8334 
8335 void
8337  DMA_MODULE_ID index ,
8338  DMA_CHANNEL channel ,
8339  DMA_CHANNEL_PRIORITY channelPriority ) ;
8340 //******************************************************************************
8341 /* Function:
8342  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8343  DMA_CHANNEL channel )
8344  Summary:
8345  Gets the priority of the specified channel.
8346  Description:
8347  This function gets the priority of the specified channel.
8348  Precondition:
8349  None.
8350  Parameters:
8351  channel - One of the existing DMA channels listed by DMA_CHANNEL
8352  Returns:
8353  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8354  Example:
8355  <code>
8356  DMA_CHANNEL channel = DMA_CHANNEL_0;
8357  DMA_CHANNEL_PRIORITY channelPriority;
8358  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8359  </code>
8360  Remarks:
8361  This function implements an operation of the ChannelXPriority feature.
8362  This feature may not be available on all devices. Please refer to the
8363  specific device data sheet to determine availability or use the
8364  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8365  whether this feature is available.
8366 */
8367 
8368 DMA_CHANNEL_PRIORITY
8370  DMA_MODULE_ID index ,
8371  DMA_CHANNEL channel ) ;
8372 //******************************************************************************
8373 /* Function:
8374  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8375  DMA_CHANNEL_PRIORITY channelPriority )
8376  Summary:
8377  Sets the priority scheme of the DMA channels.
8378  Description:
8379  This function sets the priority scheme of the DMA channels at the global level.
8380  This function is used in devices that do not have the per channel priority feature.
8381  Precondition:
8382  None.
8383  Parameters:
8384  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8385  Returns:
8386  None.
8387  Example:
8388  <code>
8389  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8390  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8391  </code>
8392  Remarks:
8393  This feature is not available on all devices. Please refer to the specific
8394  device data sheet to determine availability.
8395 */
8396 
8397 void
8399  DMA_MODULE_ID index ,
8400  DMA_CHANNEL_PRIORITY channelPriority ) ;
8401 //******************************************************************************
8402 /* Function:
8403  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8404  Summary:
8405  Gets the priority scheme of the DMA channels.
8406  Description:
8407  This function gets the priority scheme of the DMA channels at the global level.
8408  This function is used in devices that do not have the per channel priority feature.
8409  Precondition:
8410  None.
8411  Parameters:
8412  None.
8413  Returns:
8414  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8415  Example:
8416  <code>
8417  DMA_CHANNEL_PRIORITY channelPriority;
8418  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8419  </code>
8420  Remarks:
8421  This feature is not available on all devices. Please refer to the specific
8422  device data sheet to determine availability.
8423 */
8424 
8425 DMA_CHANNEL_PRIORITY
8427  DMA_MODULE_ID index ) ;
8428 //******************************************************************************
8429 /* Function:
8430  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8431  DMA_CHANNEL channel )
8432  Summary:
8433  Channel is continuously enabled.
8434  Description:
8435  This function enables the channel continuously. The channel is not automatically
8436  disabled after a block transfer is complete.
8437  Precondition:
8438  None.
8439  Parameters:
8440  channel - One of the possible DMA channels listed by DMA_CHANNEL
8441  Returns:
8442  None.
8443  Example:
8444  <code>
8445  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8446  </code>
8447  Remarks:
8448  This function implements an operation of the ChannelXAuto feature.
8449  This feature may not be available on all devices. Please refer to the
8450  specific device data sheet to determine availability or use the
8451  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8452  whether this feature is available.
8453 */
8454 
8455 void
8457  DMA_MODULE_ID index ,
8458  DMA_CHANNEL channel ) ;
8459 //******************************************************************************
8460 /* Function:
8461  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8462  DMA_CHANNEL channel )
8463  Summary:
8464  Returns the channel automatic enable status.
8465  Description:
8466  This function returns the channel automatic enable status.
8467  Precondition:
8468  None.
8469  Parameters:
8470  channel - One of the possible DMA channels listed by DMA_CHANNEL
8471  Returns:
8472  - true - Channel automatic enable is on
8473  - false - Channel automatic enable is off
8474  Example:
8475  <code>
8476  bool ChAutoEnableStatus;
8477  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8478  </code>
8479  Remarks:
8480  This function implements an operation of the ChannelXAuto feature.
8481  This feature may not be available on all devices. Please refer to the
8482  specific device data sheet to determine availability or use the
8483  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8484  whether this feature is available.
8485 */
8486 
8487 bool
8489  DMA_MODULE_ID index ,
8490  DMA_CHANNEL channel ) ;
8491 //******************************************************************************
8492 /* Function:
8493  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8494  DMA_CHANNEL channel )
8495  Summary:
8496  Channel is disabled after a block transfer is complete.
8497  Description:
8498  This function disables a channel after a block transfer is complete.
8499  Precondition:
8500  None.
8501  Parameters:
8502  channel - One of the possible DMA channels listed by DMA_CHANNEL
8503  Returns:
8504  None.
8505  Example:
8506  <code>
8507  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8508  </code>
8509  Remarks:
8510  This function implements an operation of the ChannelXAuto feature.
8511  This feature may not be available on all devices. Please refer to the
8512  specific device data sheet to determine availability or use the
8513  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8514  whether this feature is available.
8515 */
8516 
8517 void
8519  DMA_MODULE_ID index ,
8520  DMA_CHANNEL channel ) ;
8521 //******************************************************************************
8522 /* Function:
8523  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8524  DMA_CHANNEL channel )
8525  Summary:
8526  Channel chain feature is enabled.
8527  Description:
8528  This function enables the channel chain feature.
8529  Precondition:
8530  None.
8531  Parameters:
8532  channel - One of the possible DMA channels listed by DMA_CHANNEL
8533  Returns:
8534  None.
8535  Example:
8536  <code>
8537  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8538  </code>
8539  Remarks:
8540  This function implements an operation of the ChannelXChainEnbl feature.
8541  This feature may not be available on all devices. Please refer to the
8542  specific device data sheet to determine availability or use the
8543  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8544  whether this feature is available.
8545 */
8546 
8547 void
8549  DMA_MODULE_ID index ,
8550  DMA_CHANNEL channel ) ;
8551 //******************************************************************************
8552 /* Function:
8553  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8554  DMA_CHANNEL channel )
8555  Summary:
8556  Returns the chain status of the specified channel.
8557  Description:
8558  This function returns the chain status of the specified channel.
8559  Precondition:
8560  None.
8561  Parameters:
8562  channel - One of the possible DMA channels listed by DMA_CHANNEL
8563  Returns:
8564  - true - The channel chain is on for this channel
8565  - false - The channel chain is off for this channel
8566  Example:
8567  <code>
8568  bool ChchainStatus;
8569  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8570  </code>
8571  Remarks:
8572  This function implements an operation of the ChannelXChainEnbl feature.
8573  This feature may not be available on all devices. Please refer to the
8574  specific device data sheet to determine availability or use the
8575  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8576  whether this feature is available.
8577 */
8578 
8579 bool
8581  DMA_MODULE_ID index ,
8582  DMA_CHANNEL channel ) ;
8583 //******************************************************************************
8584 /* Function:
8585  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8586  DMA_CHANNEL channel )
8587  Summary:
8588  Disables the channel chaining for the specified DMA channel.
8589  Description:
8590  This function disables the channel chaining for the specified DMA channel.
8591  Precondition:
8592  None.
8593  Parameters:
8594  channel - One of the possible DMA channels listed by DMA_CHANNEL
8595  Returns:
8596  None.
8597  Example:
8598  <code>
8599  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8600  </code>
8601  Remarks:
8602  This function implements an operation of the ChannelXChainEnbl feature.
8603  This feature may not be available on all devices. Please refer to the
8604  specific device data sheet to determine availability or use the
8605  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8606  whether this feature is available.
8607 */
8608 
8609 void
8611  DMA_MODULE_ID index ,
8612  DMA_CHANNEL channel ) ;
8613 //******************************************************************************
8614 /* Function:
8615  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8616  DMA_CHANNEL channel )
8617  Summary:
8618  Channel start/abort events will be registered even if the channel is
8619  disabled.
8620  Description:
8621  This function will allow the channel register start/abort events even if the
8622  channel is disabled.
8623  Precondition:
8624  None.
8625  Parameters:
8626  channel - One of the possible DMA channels listed by DMA_CHANNEL
8627  Returns:
8628  None.
8629  Example:
8630  <code>
8631  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8632  </code>
8633  Remarks:
8634  This function implements an operation of the ChannelXDisabled feature.
8635  This feature may not be available on all devices. Please refer to the
8636  specific device data sheet to determine availability or use the
8637  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8638  determine whether this feature is available.
8639 */
8640 
8641 void
8643  DMA_MODULE_ID index ,
8644  DMA_CHANNEL channel ) ;
8645 //******************************************************************************
8646 /* Function:
8647  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
8648  DMA_CHANNEL channel )
8649  Summary:
8650  Channel start/abort events will be ignored even if the channel is
8651  disabled.
8652  Description:
8653  This function will allow the channel start/abort events to be ignored even if
8654  the channel is disabled.
8655  Precondition:
8656  None.
8657  Parameters:
8658  channel - One of the possible DMA channels listed by DMA_CHANNEL
8659  Returns:
8660  None.
8661  Example:
8662  <code>
8663  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8664  </code>
8665  Remarks:
8666  This function implements an operation of the ChannelXDisabled feature.
8667  This feature may not be available on all devices. Please refer to the
8668  specific device data sheet to determine availability or use the
8669  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8670  determine whether this feature is available.
8671 */
8672 
8673 void
8675  DMA_MODULE_ID index ,
8676  DMA_CHANNEL channel ) ;
8677 //******************************************************************************
8678 /* Function:
8679  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
8680  DMA_CHANNEL channel )
8681  Summary:
8682  Enable the specified channel.
8683  Description:
8684  This function will enable the specified channel.
8685  Precondition:
8686  None.
8687  Parameters:
8688  channel - One of the possible DMA channels listed by DMA_CHANNEL
8689  Returns:
8690  None.
8691  Example:
8692  <code>
8693  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
8694  </code>
8695  Remarks:
8696  This function implements an operation of the ChannelX feature.
8697  This feature may not be available on all devices. Please refer to the
8698  specific device data sheet to determine availability or use the
8699  PLIB_DMA_ExistsChannelX function in your application to automatically
8700  determine whether this feature is available.
8701 */
8702 
8703 void
8705  DMA_MODULE_ID index ,
8706  DMA_CHANNEL channel ) ;
8707 //******************************************************************************
8708 /* Function:
8709  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
8710  DMA_CHANNEL channel )
8711  Summary:
8712  Return the enable status of the specified channel.
8713  Description:
8714  This function will return the enable status of the specified channel.
8715  Precondition:
8716  None.
8717  Parameters:
8718  channel - One of the possible DMA channels listed by DMA_CHANNEL
8719  Returns:
8720  - true - The specified DMA channel is enabled
8721  - false - The specified DMA channel is disabled
8722  Example:
8723  <code>
8724  bool chEnableStatus;
8725  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
8726  </code>
8727  Remarks:
8728  This function implements an operation of the ChannelX feature.
8729  This feature may not be available on all devices. Please refer to the
8730  specific device data sheet to determine availability or use the
8731  PLIB_DMA_ExistsChannelX function in your application to automatically
8732  determine whether this feature is available.
8733 */
8734 
8735 bool
8737  DMA_MODULE_ID index ,
8738  DMA_CHANNEL channel ) ;
8739 //******************************************************************************
8740 /* Function:
8741  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
8742  DMA_CHANNEL channel )
8743  Summary:
8744  Disable the specified channel.
8745  Description:
8746  This function will disable the specified channel.
8747  Precondition:
8748  None.
8749  Parameters:
8750  channel - One of the possible DMA channels listed by DMA_CHANNEL
8751  Returns:
8752  None.
8753  Example:
8754  <code>
8755  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
8756  </code>
8757  Remarks:
8758  This function implements an operation of the ChannelX feature.
8759  This feature may not be available on all devices. Please refer to the
8760  specific device data sheet to determine availability or use the
8761  PLIB_DMA_ExistsChannelX function in your application to automatically
8762  determine whether this feature is available.
8763 */
8764 
8765 void
8767  DMA_MODULE_ID index ,
8768  DMA_CHANNEL channel ) ;
8769 //******************************************************************************
8770 /* Function:
8771  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
8772  DMA_CHANNEL channel )
8773  Summary:
8774  Chains the specified channel to a channel lower in natural priority.
8775  Description:
8776  This function will chain the specified channel to a channel lower in
8777  natural priority. CH3 will be enabled by a CH4 transfer complete.
8778  Precondition:
8779  None.
8780  Parameters:
8781  channel - One of the possible DMA channels listed by DMA_CHANNEL
8782  Returns:
8783  None.
8784  Example:
8785  <code>
8786  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
8787  </code>
8788  Remarks:
8789  This function implements an operation of the ChannelXChain feature.
8790  This feature may not be available on all devices. Please refer to the
8791  specific device data sheet to determine availability or use the
8792  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8793  determine whether this feature is available.
8794 */
8795 
8796 void
8798  DMA_MODULE_ID index ,
8799  DMA_CHANNEL channel ) ;
8800 //******************************************************************************
8801 /* Function:
8802  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
8803  DMA_CHANNEL channel )
8804  Summary:
8805  Chains the specified channel to a channel higher in natural priority.
8806  Description:
8807  This function will chain the specified channel to a channel higher in
8808  natural priority. CH5 will be enabled by a CH4 transfer complete.
8809  Precondition:
8810  None.
8811  Parameters:
8812  channel - One of the possible DMA channels listed by DMA_CHANNEL
8813  Returns:
8814  None.
8815  Example:
8816  <code>
8817  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
8818  </code>
8819  Remarks:
8820  This function implements an operation of the ChannelXChain feature.
8821  This feature may not be available on all devices. Please refer to the
8822  specific device data sheet to determine availability or use the
8823  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8824  determine whether this feature is available.
8825 */
8826 
8827 void
8829  DMA_MODULE_ID index ,
8830  DMA_CHANNEL channel ) ;
8831 //******************************************************************************
8832 /* Function:
8833  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
8834  DMA_CHANNEL channel )
8835  Summary:
8836  Sets the Busy bit to active.
8837  Description:
8838  This function sets the Busy bit to active, indicating the channel is active
8839  or has been enabled.
8840  Precondition:
8841  None.
8842  Parameters:
8843  channel - One of the possible DMA channels listed by DMA_CHANNEL
8844  Returns:
8845  None.
8846  Example:
8847  <code>
8848  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8849  </code>
8850  Remarks:
8851  This function implements an operation of the ChannelXBusy feature.
8852  This feature may not be available on all devices. Please refer to the
8853  specific device data sheet to determine availability or use the
8854  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8855  determine whether this feature is available.
8856 */
8857 
8858 void
8860  DMA_MODULE_ID index ,
8861  DMA_CHANNEL channel ) ;
8862 //******************************************************************************
8863 /* Function:
8864  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
8865  DMA_CHANNEL channel )
8866  Summary:
8867  Sets the Busy bit to inactive.
8868  Description:
8869  This function sets the Busy bit to inactive, indicating the channel is inactive
8870  or has been disabled.
8871  Precondition:
8872  None.
8873  Parameters:
8874  channel - One of the possible DMA channels listed by DMA_CHANNEL
8875  Returns:
8876  None.
8877  Example:
8878  <code>
8879  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8880  </code>
8881  Remarks:
8882  This function implements an operation of the ChannelXBusy feature.
8883  This feature may not be available on all devices. Please refer to the
8884  specific device data sheet to determine availability or use the
8885  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8886  determine whether this feature is available.
8887 */
8888 
8889 void
8891  DMA_MODULE_ID index ,
8892  DMA_CHANNEL channel ) ;
8893 //******************************************************************************
8894 /* Function:
8895  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
8896  DMA_CHANNEL channel )
8897  Summary:
8898  Returns the busy status of the specified channel.
8899  Description:
8900  This function returns the busy status of the specified channel.
8901  Precondition:
8902  None.
8903  Parameters:
8904  channel - One of the possible DMA channels listed by DMA_CHANNEL
8905  Returns:
8906  - true - The channel is active or has been enabled
8907  - false - The channel is inactive or has been disabled
8908  Example:
8909  <code>
8910  bool chBusyStatus;
8911  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
8912  </code>
8913  Remarks:
8914  This function implements an operation of the ChannelXBusy feature.
8915  This feature may not be available on all devices. Please refer to the
8916  specific device data sheet to determine availability or use the
8917  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8918  determine whether this feature is available.
8919 */
8920 
8921 bool
8923  DMA_MODULE_ID index ,
8924  DMA_CHANNEL channel ) ;
8925 //******************************************************************************
8926 /* Function:
8927  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
8928  DMA_CHANNEL channel,
8929  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
8930  Summary:
8931  Selects the data transfer direction of the specified channel.
8932  Description:
8933  This function selects the data transfer direction of the specified channel.
8934  Precondition:
8935  None.
8936  Parameters:
8937  channel - One of the possible DMA channels listed by DMA_CHANNEL
8938  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
8939  Returns:
8940  None.
8941  Example:
8942  <code>
8943  PLIB_DMA_ChannelXTransferDirectionSelect (
8944  DMA_ID_0,
8945  DMA_CHANNEL_4,
8946  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
8947  </code>
8948  Remarks:
8949  This feature is not available on all devices. Please refer to the specific
8950  device data sheet to determine availability.
8951 */
8952 
8953 void
8955  DMA_MODULE_ID index ,
8956  DMA_CHANNEL channel ,
8957  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
8958 //******************************************************************************
8959 /* Function:
8960  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
8961  DMA_MODULE_ID index,
8962  DMA_CHANNEL channel)
8963  Summary:
8964  Returns the data transfer direction of the specified channel.
8965  Description:
8966  This function returns the data transfer direction of the specified channel.
8967  Precondition:
8968  None.
8969  Parameters:
8970  channel - One of the possible DMA channels listed by DMA_CHANNEL
8971  Returns:
8972  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
8973  DMA_CHANNEL_TRANSFER_DIRECTION
8974  Example:
8975  <code>
8976  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
8977  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
8978  DMA_ID_0,
8979  DMA_CHANNEL_4 );
8980  </code>
8981  Remarks:
8982  This feature is not available on all devices. Please refer to the specific
8983  device data sheet to determine availability.
8984 */
8985 
8986 DMA_CHANNEL_TRANSFER_DIRECTION
8988  DMA_MODULE_ID index ,
8989  DMA_CHANNEL channel ) ;
8990 //******************************************************************************
8991 /* Function:
8992  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
8993  DMA_CHANNEL channel ,
8994  uint16_t address,
8995  DMA_ADDRESS_OFFSET_TYPE offset )
8996  Summary:
8997  Sets the primary/secondary start address (DPSRAM) offset to the value
8998  specified depending on the offset type specified for the specified channel.
8999  Description:
9000  This function sets the primary/secondary start address (DPSRAM) offset to the value
9001  specified depending on the offset type specified for the specified channel.
9002  Precondition:
9003  None.
9004  Parameters:
9005  channel - One of the possible DMA channels listed by DMA_CHANNEL
9006  address - The primary/secondary DPSRAM start address offset
9007  offset - The type of the address offset (primary/secondary)
9008  Returns:
9009  None.
9010  Example:
9011  <code>
9012  uint16_t address = 0x100;
9013  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
9014  DMA_CHANNEL_4,
9015  address,
9016  DMA_ADDRESS_OFFSET_PRIMARY );
9017  </code>
9018  Remarks:
9019  This feature is not available on all devices. Please refer to the specific
9020  device data sheet to determine availability.
9021 */
9022 
9023 void
9025  DMA_MODULE_ID index ,
9026  DMA_CHANNEL channel ,
9027  uint16_t address ,
9028  DMA_ADDRESS_OFFSET_TYPE offset ) ;
9029 //******************************************************************************
9030 /* Function:
9031  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
9032  DMA_CHANNEL channel,
9033  DMA_ADDRESS_OFFSET_TYPE offset)
9034  Summary:
9035  Gets the primary/secondary start address (DPSRAM) offset.
9036  Description:
9037  This function gets the primary/secondary start address (DPSRAM) offset.
9038  Precondition:
9039  None.
9040  Parameters:
9041  channel - One of the possible DMA channels listed by DMA_CHANNEL
9042  offset - The type of the address offset (primary/secondary)
9043  Returns:
9044  - uint16_t - The primary/secondary DPSRAM start address offset
9045  Example:
9046  <code>
9047  uint16_t addressOffsetA;
9048  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
9049  DMA_ID_0,
9050  DMA_CHANNEL_4,
9051  address,
9052  DMA_ADDRESS_OFFSET_PRIMARY );
9053  </code>
9054  Remarks:
9055  This feature is not available on all devices. Please refer to the specific
9056  device data sheet to determine availability.
9057 */
9058 
9059 uint16_t
9061  DMA_MODULE_ID index ,
9062  DMA_CHANNEL channel ,
9063  DMA_ADDRESS_OFFSET_TYPE offset ) ;
9064 //******************************************************************************
9065 /* Function:
9066  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
9067  DMA_CHANNEL channel ,
9068  uint16_t peripheraladdress )
9069  Summary:
9070  Sets the peripheral address for the specified channel.
9071  Description:
9072  This function sets the peripheral address for the specified channel.
9073  Precondition:
9074  None.
9075  Parameters:
9076  channel - One of the possible DMA channels listed by DMA_CHANNEL
9077  peripheraladdress - The peripheral address for the specified channel
9078  Returns:
9079  None.
9080  Example:
9081  <code>
9082  uint16_t peripheraladdress = 0x100;
9083  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
9084  DMA_CHANNEL_4,
9085  peripheraladdress );
9086  </code>
9087  Remarks:
9088  This feature is not available on all devices. Please refer to the specific
9089  device data sheet to determine availability.
9090 */
9091 
9092 void
9094  DMA_MODULE_ID index ,
9095  DMA_CHANNEL channel ,
9096  uint16_t peripheraladdress ) ;
9097 //******************************************************************************
9098 /* Function:
9099  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9100  DMA_CHANNEL channel )
9101  Summary:
9102  Gets the peripheral address configured for the specified channel.
9103  Description:
9104  This function gets the peripheral address configured for the specified channel.
9105  Precondition:
9106  None.
9107  Parameters:
9108  channel - One of the possible DMA channels listed by DMA_CHANNEL
9109  Returns:
9110  - uint16_t - The peripheral address configured for the specified channel
9111  Example:
9112  <code>
9113  uint16_t peripheraladdress;
9114  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9115  DMA_CHANNEL_4 );
9116  </code>
9117  Remarks:
9118  This feature is not available on all devices. Please refer to the specific
9119  device data sheet to determine availability.
9120 */
9121 
9122 uint16_t
9124  DMA_MODULE_ID index ,
9125  DMA_CHANNEL channel ) ;
9126 //******************************************************************************
9127 /* Function:
9128  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9129  DMA_CHANNEL channel ,
9130  uint16_t transferCount )
9131  Summary:
9132  Sets the DMA data transfer count for the specified channel.
9133  Description:
9134  This function sets the DMA data transfer count for the specified channel.
9135  Precondition:
9136  None.
9137  Parameters:
9138  channel - One of the possible DMA channels listed by DMA_CHANNEL
9139  transferCount - The DMA transfer count for the channel
9140  Returns:
9141  None.
9142  Example:
9143  <code>
9144  uint16_t transferCount = 0x10;
9145  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9146  DMA_CHANNEL_4,
9147  transferCount );
9148  </code>
9149  Remarks:
9150  This feature is not available on all devices. Please refer to the specific
9151  device data sheet to determine availability.
9152 */
9153 
9154 void
9156  DMA_MODULE_ID index ,
9157  DMA_CHANNEL channel ,
9158  uint16_t transferCount ) ;
9159 //******************************************************************************
9160 /* Function:
9161  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9162  DMA_CHANNEL channel )
9163  Summary:
9164  Gets the DMA data transfer count that is programmed for the specified channel.
9165  Description:
9166  This function gets the DMA data transfer count that is programmed for the specified channel.
9167  Precondition:
9168  None.
9169  Parameters:
9170  channel - One of the possible DMA channels listed by DMA_CHANNEL
9171  Returns:
9172  - uint16_t - The DMA transfer count for the channel
9173  Example:
9174  <code>
9175  uint16_t transferCount;
9176  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9177  DMA_CHANNEL_4 );
9178  </code>
9179  Remarks:
9180  This feature is not available on all devices. Please refer to the specific
9181  device data sheet to determine availability.
9182 */
9183 
9184 uint16_t
9186  DMA_MODULE_ID index ,
9187  DMA_CHANNEL channel ) ;
9188 //******************************************************************************
9189 /* Function:
9190  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9191  DMA_MODULE_ID index,
9192  DMA_CHANNEL channel,
9193  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9194  Summary:
9195  Sets the source address mode of the specified channel.
9196  Description:
9197  This function sets the source address mode of the specified channel.
9198  Precondition:
9199  None.
9200  Parameters:
9201  channel - One of the possible DMA channels listed by DMA_CHANNEL
9202  sourceAddressMode - One of the possible source addressing modes listed by
9203  DMA_SOURCE_ADDRESSING_MODE
9204  Returns:
9205  None.
9206  Example:
9207  <code>
9208  PLIB_DMA_ChannelXSourceAddressModeSelect (
9209  DMA_ID_0,
9210  DMA_CHANNEL_4,
9211  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9212  </code>
9213  Remarks:
9214  This feature is not available on all devices. Please refer to the specific
9215  device data sheet to determine availability.
9216 */
9217 
9218 void
9220  DMA_MODULE_ID index ,
9221  DMA_CHANNEL channel ,
9222  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9223 //******************************************************************************
9224 /* Function:
9225  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9226  DMA_MODULE_ID index,
9227  DMA_CHANNEL channel )
9228  Summary:
9229  Gets the source address mode of the specified channel.
9230  Description:
9231  This function gets the source address mode of the specified channel.
9232  Precondition:
9233  None.
9234  Parameters:
9235  channel - One of the possible DMA channels listed by DMA_CHANNEL
9236  Returns:
9237  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9238  listed by DMA_SOURCE_ADDRESSING_MODE
9239  Example:
9240  <code>
9241  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9242  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9243  DMA_CHANNEL_4 );
9244  </code>
9245  Remarks:
9246  This feature is not available on all devices. Please refer to the specific
9247  device data sheet to determine availability.
9248 */
9249 
9250 DMA_SOURCE_ADDRESSING_MODE
9252  DMA_MODULE_ID index ,
9253  DMA_CHANNEL channel ) ;
9254 //******************************************************************************
9255 /* Function:
9256  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9257  DMA_MODULE_ID index,
9258  DMA_CHANNEL channel,
9259  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9260  Summary:
9261  Sets the source address mode of the specified channel.
9262  Description:
9263  This function Sets the source address mode of the specified channel.
9264  Precondition:
9265  None.
9266  Parameters:
9267  channel - One of the possible DMA channels listed by DMA_CHANNEL
9268  destinationAddressMode - One of the possible source addressing modes listed by
9269  DMA_DESTINATION_ADDRESSING_MODE
9270  Returns:
9271  None.
9272  Example:
9273  <code>
9274  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9275  DMA_ID_0,
9276  DMA_CHANNEL_4,
9277  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9278  </code>
9279  Remarks:
9280  This feature is not available on all devices. Please refer to the specific
9281  device data sheet to determine availability.
9282 */
9283 
9284 void
9286  DMA_MODULE_ID index ,
9287  DMA_CHANNEL channel ,
9288  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9289 //******************************************************************************
9290 /* Function:
9291  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9292  DMA_MODULE_ID index,
9293  DMA_CHANNEL channel )
9294  Summary:
9295  Gets the source address mode of the specified channel.
9296  Description:
9297  This function gets the source address mode of the specified channel.
9298  Precondition:
9299  None.
9300  Parameters:
9301  channel - One of the possible DMA channels listed by DMA_CHANNEL
9302  Returns:
9303  - destinationAddressMode - One of the possible source addressing modes listed by
9304  DMA_DESTINATION_ADDRESSING_MODE
9305  Example:
9306  <code>
9307  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9308  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9309  DMA_ID_0,
9310  DMA_CHANNEL_4 );
9311  </code>
9312  Remarks:
9313  This feature is not available on all devices. Please refer to the specific
9314  device data sheet to determine availability.
9315 */
9316 
9317 DMA_DESTINATION_ADDRESSING_MODE
9319  DMA_MODULE_ID index ,
9320  DMA_CHANNEL channel ) ;
9321 //******************************************************************************
9322 /* Function:
9323  void PLIB_DMA_ChannelXAddressModeSelect (
9324  DMA_MODULE_ID index,
9325  DMA_CHANNEL channel,
9326  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9327  Summary:
9328  Sets the channel address mode.
9329  Description:
9330  This function sets the channel address mode.
9331  Precondition:
9332  None.
9333  Parameters:
9334  channel - One of the possible DMA channels listed by DMA_CHANNEL
9335  channelAddressMode - One of the possible channel addressing modes listed by
9336  DMA_CHANNEL_ADDRESSING_MODE
9337  Returns:
9338  None.
9339  Example:
9340  <code>
9341  PLIB_DMA_ChannelXAddressModeSelect (
9342  DMA_ID_0,
9343  DMA_CHANNEL_4,
9344  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9345  </code>
9346  Remarks:
9347  This feature is not available on all devices. Please refer to the specific
9348  device data sheet to determine availability.
9349 */
9350 
9351 void
9353  DMA_MODULE_ID index ,
9354  DMA_CHANNEL channel ,
9355  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9356 //******************************************************************************
9357 /* Function:
9358  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9359  DMA_MODULE_ID index,
9360  DMA_CHANNEL channel )
9361  Summary:
9362  Gets the channel address mode.
9363  Description:
9364  This function gets the channel address mode.
9365  Precondition:
9366  None.
9367  Parameters:
9368  channel - One of the possible DMA channels listed by DMA_CHANNEL
9369  Returns:
9370  - channelAddressMode - One of the possible source addressing modes listed by
9371  DMA_CHANNEL_ADDRESSING_MODE
9372  Example:
9373  <code>
9374  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9375  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9376  DMA_CHANNEL_4 );
9377  </code>
9378  Remarks:
9379  This feature is not available on all devices. Please refer to the specific
9380  device data sheet to determine availability.
9381 */
9382 
9383 DMA_CHANNEL_ADDRESSING_MODE
9385  DMA_MODULE_ID index ,
9386  DMA_CHANNEL channel ) ;
9387 // *****************************************************************************
9388 // *****************************************************************************
9389 // Section: DMA Channel Event Configuration functions
9390 // *****************************************************************************
9391 // *****************************************************************************
9392 //******************************************************************************
9393 /* Function:
9394  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9395  DMA_CHANNEL channel,
9396  DMA_CHANNEL_TRIGGER_TYPE trigger )
9397  Summary:
9398  Enables the specified DMA channel trigger.
9399  Description:
9400  This function enables the specified DMA channel trigger.
9401  Precondition:
9402  None.
9403  Parameters:
9404  channel - One of the possible DMA channels listed by DMA_CHANNEL
9405  trigger - Type of trigger (transfer start/abort/pattern match abort)
9406  Returns:
9407  None.
9408  Example:
9409  <code>
9410  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9411  DMA_CHANNEL_4,
9412  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9413  </code>
9414  Remarks:
9415  This function implements an operation of the ChannelXTrigger feature.
9416  This feature may not be available on all devices. Please refer to the
9417  specific device data sheet to determine availability or use the
9418  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9419  determine whether this feature is available.
9420 */
9421 
9422 void
9424  DMA_MODULE_ID index ,
9425  DMA_CHANNEL channel ,
9426  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9427 //******************************************************************************
9428 /* Function:
9429  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9430  DMA_CHANNEL channel,
9431  DMA_CHANNEL_TRIGGER_TYPE trigger )
9432  Summary:
9433  Returns the enable status of the specified DMA transfer/abort trigger.
9434  Description:
9435  This function returns the enable status of the specified DMA transfer/abort trigger.
9436  Precondition:
9437  None.
9438  Parameters:
9439  channel - One of the possible DMA channels listed by DMA_CHANNEL
9440  trigger - Type of trigger (transfer start/abort/pattern match abort)
9441  Returns:
9442  - true - The specified trigger is enabled
9443  - false - The specified trigger is disabled
9444  Example:
9445  <code>
9446  bool startTriggerstatus;
9447  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9448  DMA_ID_0,
9449  DMA_CHANNEL_4,
9450  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9451  </code>
9452  Remarks:
9453  This function implements an operation of the ChannelXTrigger feature.
9454  This feature may not be available on all devices. Please refer to the
9455  specific device data sheet to determine availability or use the
9456  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9457  determine whether this feature is available.
9458 */
9459 
9460 bool
9462  DMA_MODULE_ID index ,
9463  DMA_CHANNEL channel ,
9464  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9465 //******************************************************************************
9466 /* Function:
9467  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9468  DMA_CHANNEL channel,
9469  DMA_CHANNEL_TRIGGER_TYPE trigger )
9470  Summary:
9471  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9472  Description:
9473  This function disables the DMA transfer abort via a matching interrupt
9474  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9475  a transfer.
9476  Precondition:
9477  None.
9478  Parameters:
9479  channel - One of the possible DMA channels listed by DMA_CHANNEL
9480  trigger - Type of trigger (transfer start/abort/pattern match abort)
9481  Returns:
9482  None.
9483  Example:
9484  <code>
9485  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9486  DMA_CHANNEL_4,
9487  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9488  </code>
9489  Remarks:
9490  This function implements an operation of the ChannelXTrigger feature.
9491  This feature may not be available on all devices. Please refer to the
9492  specific device data sheet to determine availability or use the
9493  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9494  determine whether this feature is available.
9495 */
9496 
9497 void
9499  DMA_MODULE_ID index ,
9500  DMA_CHANNEL channel ,
9501  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9502 //******************************************************************************
9503 /* Function:
9504  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9505  DMA_CHANNEL channel)
9506  Summary:
9507  Gets the source number for the DMA channel interrupts.
9508  Description:
9509  This function returns the interrupt source number for the specified
9510  DMA channel.
9511  Precondition:
9512  None.
9513  Parameters:
9514  channel - One of the possible DMA channels listed by DMA_CHANNEL
9515  Returns:
9516  None.
9517  Example:
9518  <code>
9519  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9520  DMA_CHANNEL_4);
9521  </code>
9522  Remarks:
9523  This function implements an operation of the ChannelXTrigger feature.
9524  This feature may not be available on all devices. Please refer to the
9525  specific device data sheet to determine availability or use the
9526  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9527  determine whether this feature is available.
9528 */
9529 
9530 DMA_CHANNEL_INT_SOURCE
9532  DMA_MODULE_ID index ,
9533  DMA_CHANNEL channel ) ;
9534 //******************************************************************************
9535 /* Function:
9536  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9537  DMA_CHANNEL channel,
9538  DMA_TRIGGER_SOURCE IRQnum )
9539  Summary:
9540  Sets the IRQ to initiate the DMA transfer on the specified channel.
9541  Description:
9542  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9543  (IRQ to start the channel transfer.)
9544  Precondition:
9545  None.
9546  Parameters:
9547  channel - One of the possible DMA channels listed by DMA_CHANNEL
9548  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9549  Returns:
9550  None.
9551  Example:
9552  <code>
9553  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9554  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9555  DMA_CHANNEL_4,
9556  irq );
9557  </code>
9558  Remarks:
9559  This function implements an operation of the ChannelXStartIRQ feature.
9560  This feature may not be available on all devices. Please refer to the
9561  specific device data sheet to determine availability or use the
9562  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9563  determine whether this feature is available.
9564 */
9565 
9566 void
9568  DMA_MODULE_ID index ,
9569  DMA_CHANNEL channel ,
9570  DMA_TRIGGER_SOURCE IRQnum ) ;
9571 //******************************************************************************
9572 /* Function:
9573  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9574  DMA_CHANNEL channel,
9575  DMA_TRIGGER_SOURCE IRQ )
9576  Summary:
9577  Sets the IRQ to abort the DMA transfer on the specified channel.
9578  Description:
9579  This function sets the IRQ to abort the DMA transfer on the specified channel.
9580  (IRQ to start the channel transfer.)
9581  Precondition:
9582  None.
9583  Parameters:
9584  channel - One of the possible DMA channels listed by DMA_CHANNEL
9585  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9586  Returns:
9587  None.
9588  Example:
9589  <code>
9590  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9591  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9592  DMA_CHANNEL_4,
9593  irq );
9594  </code>
9595  Remarks:
9596  This function implements an operation of the ChannelXAbortIRQ feature.
9597  This feature may not be available on all devices. Please refer to the
9598  specific device data sheet to determine availability or use the
9599  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9600  determine whether this feature is available.
9601 */
9602 
9603 void
9605  DMA_MODULE_ID index ,
9606  DMA_CHANNEL channel ,
9607  DMA_TRIGGER_SOURCE IRQ ) ;
9608 //******************************************************************************
9609 /* Function:
9610  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9611  DMA_CHANNEL channel,
9612  DMA_CHANNEL_DATA_SIZE channelDataSize )
9613  Summary:
9614  Selects the data size for the specified channel.
9615  Description:
9616  This function selects the data size for the specified channel.
9617  Precondition:
9618  None.
9619  Parameters:
9620  channel - One of the possible DMA channels listed by DMA_CHANNEL
9621  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9622  Returns:
9623  None.
9624  Example:
9625  <code>
9626  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9627  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9628  DMA_CHANNEL_4,
9629  channelDataSize );
9630  </code>
9631  Remarks:
9632  This feature is not available on all devices. Please refer to the specific
9633  device data sheet to determine availability.
9634 */
9635 
9636 void
9638  DMA_MODULE_ID index ,
9639  DMA_CHANNEL channel ,
9640  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
9641 //******************************************************************************
9642 /* Function:
9643  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
9644  DMA_CHANNEL channel )
9645  Summary:
9646  Returns the current data size for the specified channel.
9647  Description:
9648  This function returns the current data size for the specified channel.
9649  Precondition:
9650  None.
9651  Parameters:
9652  channel - One of the possible DMA channels listed by DMA_CHANNEL
9653  Returns:
9654  - channelDataSize - One of the possible data sizes listed by
9655  DMA_CHANNEL_DATA_SIZE
9656  Example:
9657  <code>
9658  DMA_CHANNEL_DATA_SIZE channelDataSize;
9659  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
9660  DMA_CHANNEL_4 );
9661  </code>
9662  Remarks:
9663  This feature is not available on all devices. Please refer to the specific
9664  device data sheet to determine availability.
9665 */
9666 
9667 DMA_CHANNEL_DATA_SIZE
9669  DMA_MODULE_ID index ,
9670  DMA_CHANNEL channel ) ;
9671 //******************************************************************************
9672 /* Function:
9673  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
9674  DMA_MODULE_ID index,
9675  DMA_CHANNEL channel,
9676  DMA_TRANSFER_MODE channeltransferMode )
9677  Summary:
9678  Selects the transfer/operating mode for the specified channel.
9679  Description:
9680  This function selects the transfer/operating mode for the specified channel.
9681  (Transfer mode and operating mode are used interchangeably.)
9682  Precondition:
9683  None.
9684  Parameters:
9685  channel - One of the possible DMA channels listed by DMA_CHANNEL
9686  channeltransferMode - One of the possible operating/transfer modes listed by
9687  DMA_TRANSFER_MODE
9688  Returns:
9689  None.
9690  Example:
9691  <code>
9692  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
9693  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
9694  DMA_CHANNEL_4,
9695  channeltransferMode );
9696  </code>
9697  Remarks:
9698  This feature is not available on all devices. Please refer to the specific
9699  device data sheet to determine availability.
9700 */
9701 
9702 void
9704  DMA_MODULE_ID index ,
9705  DMA_CHANNEL channel ,
9706  DMA_TRANSFER_MODE channeltransferMode ) ;
9707 //******************************************************************************
9708 /* Function:
9709  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
9710  DMA_MODULE_ID index,
9711  DMA_CHANNEL channel )
9712  Summary:
9713  Returns the current transfer/operating mode for the specified channel.
9714  Description:
9715  This function returns the current transfer/operating mode for the specified channel.
9716  (Transfer mode and operating mode are used interchangeably.)
9717  Precondition:
9718  None.
9719  Parameters:
9720  channel - One of the possible DMA channels listed by DMA_CHANNEL
9721  Returns:
9722  - channeltransferMode - One of the possible operating/transfer modes listed
9723  by DMA_TRANSFER_MODE
9724  Example:
9725  <code>
9726  DMA_TRANSFER_MODE channeltransferMode;
9727  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
9728  DMA_ID_0,
9729  DMA_CHANNEL_4 );
9730  </code>
9731  Remarks:
9732  This feature is not available on all devices. Please refer to the specific
9733  device data sheet to determine availability.
9734 */
9735 
9736 DMA_TRANSFER_MODE
9738  DMA_MODULE_ID index ,
9739  DMA_CHANNEL channel ) ;
9740 //******************************************************************************
9741 /* Function:
9742  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
9743  DMA_CHANNEL channel )
9744  Summary:
9745  Enables reloading of the address and count registers.
9746  Description:
9747  This function enables reloading of the address and count registers. The source,
9748  destination address, and the DMA count registers are reloaded to their previous
9749  values upon the start of the next operation.
9750  Precondition:
9751  None.
9752  Parameters:
9753  channel - One of the possible DMA channels listed by DMA_CHANNEL
9754  Returns:
9755  None.
9756  Example:
9757  <code>
9758  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
9759  DMA_CHANNEL_4 );
9760  </code>
9761  Remarks:
9762  This feature is not available on all devices. Please refer to the specific
9763  device data sheet to determine availability.
9764 */
9765 
9766 void
9768  DMA_MODULE_ID index ,
9769  DMA_CHANNEL channel ) ;
9770 //******************************************************************************
9771 /* Function:
9772  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
9773  DMA_CHANNEL channel )
9774  Summary:
9775  Returns the address and count registers reload enable status.
9776  Description:
9777  This function returns the address and count registers reload enable status.
9778  Precondition:
9779  None.
9780  Parameters:
9781  channel - One of the possible DMA channels listed by DMA_CHANNEL
9782  Returns:
9783  - true - The address and count registers reload is enabled
9784  - false - The address and count registers reload is disabled
9785  Example:
9786  <code>
9787  bool chAddressCountReloadStatus;
9788  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
9789  DMA_ID_0,
9790  DMA_CHANNEL_4 );
9791  </code>
9792  Remarks:
9793  This feature is not available on all devices. Please refer to the specific
9794  device data sheet to determine availability.
9795 */
9796 
9797 bool
9799  DMA_MODULE_ID index ,
9800  DMA_CHANNEL channel ) ;
9801 //******************************************************************************
9802 /* Function:
9803  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
9804  DMA_CHANNEL channel )
9805  Summary:
9806  Disables reloading of the address and count registers.
9807  Description:
9808  This function disables reloading of the address and count registers. The source, destination
9809  address, and the DMA count registers are not reloaded to their previous values upon
9810  the start of the next operation.
9811  Precondition:
9812  None.
9813  Parameters:
9814  channel - One of the possible DMA channels listed by DMA_CHANNEL
9815  Returns:
9816  None.
9817  Example:
9818  <code>
9819  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
9820  DMA_CHANNEL_4 );
9821  </code>
9822  Remarks:
9823  This feature is not available on all devices. Please refer to the specific
9824  device data sheet to determine availability.
9825 */
9826 
9827 void
9829  DMA_MODULE_ID index ,
9830  DMA_CHANNEL channel ) ;
9831 //******************************************************************************
9832 /* Function:
9833  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
9834  DMA_CHANNEL channel )
9835  Summary:
9836  Enables the Null Write mode.
9837  Description:
9838  This function enables the Null Write mode. A dummy write is initiated to the
9839  source address for every write to the destination address.
9840  Precondition:
9841  None.
9842  Parameters:
9843  channel - One of the possible DMA channels listed by DMA_CHANNEL
9844  Returns:
9845  None.
9846  Example:
9847  <code>
9848  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
9849  DMA_CHANNEL_4 );
9850  </code>
9851  Remarks:
9852  This feature is not available on all devices. Please refer to the specific
9853  device data sheet to determine availability.
9854 */
9855 
9856 void
9858  DMA_MODULE_ID index ,
9859  DMA_CHANNEL channel ) ;
9860 //******************************************************************************
9861 /* Function:
9862  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
9863  DMA_CHANNEL channel )
9864  Summary:
9865  Returns the enable status of the Null Write mode for the specified channel.
9866  Description:
9867  This function returns the enable status of the Null Write mode for the specified channel.
9868  Precondition:
9869  None.
9870  Parameters:
9871  channel - One of the possible DMA channels listed by DMA_CHANNEL
9872  Returns:
9873  - true - Null write mode is enabled for this channel
9874  - false - Null write mode is disabled for this channel
9875  Example:
9876  <code>
9877  bool chNullWriteStatus;
9878  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
9879  DMA_ID_0,
9880  DMA_CHANNEL_4 );
9881  </code>
9882  Remarks:
9883  This feature is not available on all devices. Please refer to the specific
9884  device data sheet to determine availability.
9885 */
9886 
9887 bool
9889  DMA_MODULE_ID index ,
9890  DMA_CHANNEL channel ) ;
9891 //******************************************************************************
9892 /* Function:
9893  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
9894  DMA_CHANNEL channel )
9895  Summary:
9896  Disables the Null Write mode.
9897  Description:
9898  This function disables the Null Write mode. No dummy write is initiated.
9899  Precondition:
9900  None.
9901  Parameters:
9902  channel - One of the possible DMA channels listed by DMA_CHANNEL
9903  Returns:
9904  None.
9905  Example:
9906  <code>
9907  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
9908  DMA_CHANNEL_4 );
9909  </code>
9910  Remarks:
9911  This feature is not available on all devices. Please refer to the specific
9912  device data sheet to determine availability.
9913 */
9914 
9915 void
9917  DMA_MODULE_ID index ,
9918  DMA_CHANNEL channel ) ;
9919 // *****************************************************************************
9920 // *****************************************************************************
9921 // Section: DMA start/end functions
9922 // *****************************************************************************
9923 // *****************************************************************************
9924 //******************************************************************************
9925 /* Function:
9926  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
9927  DMA_CHANNEL channel )
9928  Summary:
9929  Initiates transfer on the specified channel.
9930  Description:
9931  This function initiates transfer on the specified channel. This is a forced transfer
9932  controlled via software.
9933  Precondition:
9934  None.
9935  Parameters:
9936  channel - One of the possible DMA channels listed by DMA_CHANNEL
9937  Returns:
9938  None.
9939  Example:
9940  <code>
9941  PLIB_DMA_StartTransferSet ( DMA_ID_0,
9942  DMA_CHANNEL_4 );
9943  </code>
9944  Remarks:
9945  This function implements an operation of the StartTransfer feature.
9946  This feature may not be available on all devices. Please refer to the
9947  specific device data sheet to determine availability or use the
9948  PLIB_DMA_ExistsStartTransfer function in your application to automatically
9949  determine whether this feature is available.
9950 */
9951 
9952 void
9954  DMA_MODULE_ID index ,
9955  DMA_CHANNEL channel ) ;
9956 //******************************************************************************
9957 /* Function:
9958  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
9959  DMA_CHANNEL channel )
9960  Summary:
9961  Aborts transfer on the specified channel.
9962  Description:
9963  This function aborts transfer on the specified channel. This is a forced abort
9964  controlled via software.
9965  Precondition:
9966  None.
9967  Parameters:
9968  channel - One of the possible DMA channels listed by DMA_CHANNEL
9969  Returns:
9970  None.
9971  Example:
9972  <code>
9973  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
9974  DMA_CHANNEL_4 );
9975  </code>
9976  Remarks:
9977  This function implements an operation of the AbortTransfer feature.
9978  This feature may not be available on all devices. Please refer to the
9979  specific device data sheet to determine availability or use the
9980  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
9981  determine whether this feature is available.
9982 */
9983 
9984 void
9986  DMA_MODULE_ID index ,
9987  DMA_CHANNEL channel ) ;
9988 // *****************************************************************************
9989 // *****************************************************************************
9990 // Section: DMA General Configuration functions
9991 // *****************************************************************************
9992 // *****************************************************************************
9993 //******************************************************************************
9994 /* Function:
9995  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
9996  Summary:
9997  Sets the BUSY bit of the DMA controller.
9998  Description:
9999  This function sets the BUSY bit of the DMA controller. The DMA module is active.
10000  Precondition:
10001  None.
10002  Parameters:
10003  None.
10004  Returns:
10005  None.
10006  Example:
10007  <code>
10008  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
10009  </code>
10010  Remarks:
10011  This function implements an operation of the Busy feature.
10012  This feature may not be available on all devices. Please refer to the
10013  specific device data sheet to determine availability or use the
10014  PLIB_DMA_ExistsBusy function in your application to automatically
10015  determine whether this feature is available.
10016 */
10017 
10018 void
10020  DMA_MODULE_ID index ) ;
10021 //******************************************************************************
10022 /* Function:
10023  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
10024  Summary:
10025  Resets the BUSY bit of the DMA controller.
10026  Description:
10027  This function resets the BUSY bit of the DMA controller. The DMA module is
10028  disabled and is not actively transferring data.
10029  Precondition:
10030  None.
10031  Parameters:
10032  None.
10033  Returns:
10034  None.
10035  Example:
10036  <code>
10037  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
10038  </code>
10039  Remarks:
10040  This function implements an operation of the Busy feature.
10041  This feature may not be available on all devices. Please refer to the
10042  specific device data sheet to determine availability or use the
10043  PLIB_DMA_ExistsBusy function in your application to automatically
10044  determine whether this feature is available.
10045 */
10046 
10047 void
10049  DMA_MODULE_ID index ) ;
10050 //******************************************************************************
10051 /* Function:
10052  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
10053  Summary:
10054  Gets the BUSY bit of the DMA controller.
10055  Description:
10056  This function gets the BUSY bit of the DMA controller.
10057  Precondition:
10058  None.
10059  Parameters:
10060  None.
10061  Returns:
10062  - true - DMA module is active
10063  - false - DMA module is disabled and is not actively transferring data
10064  Example:
10065  <code>
10066  bool dmaBusyStatus;
10067  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
10068  </code>
10069  Remarks:
10070  This function implements an operation of the Busy feature.
10071  This feature may not be available on all devices. Please refer to the
10072  specific device data sheet to determine availability or use the
10073  PLIB_DMA_ExistsBusy function in your application to automatically
10074  determine whether this feature is available.
10075 */
10076 
10077 bool
10078  PLIB_DMA_IsBusy (
10079  DMA_MODULE_ID index ) ;
10080 //******************************************************************************
10081 /* Function:
10082  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
10083  Summary:
10084  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
10085  Description:
10086  This function suspends the DMA transfers to allow uninterrupted access
10087  by the CPU to the data bus.
10088  Precondition:
10089  None.
10090  Parameters:
10091  None.
10092  Returns:
10093  None.
10094  Example:
10095  <code>
10096  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10097  </code>
10098  Remarks:
10099  This function implements an operation of the Suspend feature.
10100  This feature may not be available on all devices. Please refer to the
10101  specific device data sheet to determine availability or use the
10102  PLIB_DMA_ExistsSuspend function in your application to automatically
10103  determine whether this feature is available.
10104 */
10105 
10106 void
10108  DMA_MODULE_ID index ) ;
10109 //******************************************************************************
10110 /* Function:
10111  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10112  Summary:
10113  DMA suspend is disabled and the DMA module operates normally.
10114  Description:
10115  This function disables the DMA suspend. The DMA module continues to operate
10116  normally.
10117  Precondition:
10118  None.
10119  Parameters:
10120  None.
10121  Returns:
10122  None.
10123  Example:
10124  <code>
10125  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10126  </code>
10127  Remarks:
10128  This function implements an operation of the Suspend feature.
10129  This feature may not be available on all devices. Please refer to the
10130  specific device data sheet to determine availability or use the
10131  PLIB_DMA_ExistsSuspend function in your application to automatically
10132  determine whether this feature is available.
10133 */
10134 
10135 void
10137  DMA_MODULE_ID index ) ;
10138 //******************************************************************************
10139 /* Function:
10140  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10141  Summary:
10142  Returns the DMA suspend status.
10143  Description:
10144  This function returns the DMA suspend status.
10145  Precondition:
10146  None.
10147  Parameters:
10148  None.
10149  Returns:
10150  - true - The DMA transfers are suspended
10151  - false - The DMA operates normally
10152  Example:
10153  <code>
10154  bool dmaSuspendStatus;
10155  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10156  </code>
10157  Remarks:
10158  This function implements an operation of the Suspend feature.
10159  This feature may not be available on all devices. Please refer to the
10160  specific device data sheet to determine availability or use the
10161  PLIB_DMA_ExistsSuspend function in your application to automatically
10162  determine whether this feature is available.
10163 */
10164 
10165 bool
10167  DMA_MODULE_ID index ) ;
10168 //******************************************************************************
10169 /* Function:
10170  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10171  Summary:
10172  DMA transfers are halted during Idle mode.
10173  Description:
10174  This function halts DMA transfers during Idle mode.
10175  Precondition:
10176  None.
10177  Parameters:
10178  None.
10179  Returns:
10180  None.
10181  Example:
10182  <code>
10183  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10184  </code>
10185  Remarks:
10186  This function implements an operation of the StopInIdle feature.
10187  This feature may not be available on all devices. Please refer to the
10188  specific device data sheet to determine availability or use the
10189  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10190  determine whether this feature is available.
10191 */
10192 
10193 void
10195  DMA_MODULE_ID index ) ;
10196 //******************************************************************************
10197 /* Function:
10198  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10199  Summary:
10200  DMA transfers continue during Idle mode.
10201  Description:
10202  This function causes DMA transfers to continue during Idle mode.
10203  Precondition:
10204  None.
10205  Parameters:
10206  None.
10207  Returns:
10208  None.
10209  Example:
10210  <code>
10211  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10212  </code>
10213  Remarks:
10214  This function implements an operation of the StopInIdle feature.
10215  This feature may not be available on all devices. Please refer to the
10216  specific device data sheet to determine availability or use the
10217  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10218  determine whether this feature is available.
10219 */
10220 
10221 void
10223  DMA_MODULE_ID index ) ;
10224 //******************************************************************************
10225 /* Function:
10226  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10227  Summary:
10228  DMA module is enabled.
10229  Description:
10230  This function enables the DMA module.
10231  Precondition:
10232  None.
10233  Parameters:
10234  None.
10235  Returns:
10236  None.
10237  Example:
10238  <code>
10239  PLIB_DMA_Enable( DMA_ID_0 );
10240  </code>
10241  Remarks:
10242  This function implements an operation of the EnableControl feature.
10243  This feature may not be available on all devices. Please refer to the
10244  specific device data sheet to determine availability or use the
10245  PLIB_DMA_ExistsEnableControl function in your application to automatically
10246  determine whether this feature is available.
10247 */
10248 
10249 void
10250  PLIB_DMA_Enable (
10251  DMA_MODULE_ID index ) ;
10252 //******************************************************************************
10253 /* Function:
10254  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10255  Summary:
10256  Returns the DMA module enable status.
10257  Description:
10258  This function returns the DMA module enable status.
10259  Precondition:
10260  None.
10261  Parameters:
10262  None.
10263  Returns:
10264  - true - The DMA is enabled
10265  - false - The DMA is disabled
10266  Example:
10267  <code>
10268  PLIB_DMA_IsEnabled( DMA_ID_0 );
10269  </code>
10270  Remarks:
10271  This function implements an operation of the EnableControl feature.
10272  This feature may not be available on all devices. Please refer to the
10273  specific device data sheet to determine availability or use the
10274  PLIB_DMA_ExistsEnableControl function in your application to automatically
10275  determine whether this feature is available.
10276 */
10277 
10278 bool
10280  DMA_MODULE_ID index ) ;
10281 //******************************************************************************
10282 /* Function:
10283  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10284  Summary:
10285  DMA module is disabled.
10286  Description:
10287  This function disables the DMA module.
10288  Precondition:
10289  None.
10290  Parameters:
10291  None.
10292  Returns:
10293  None.
10294  Example:
10295  <code>
10296  PLIB_DMA_Disable( DMA_ID_0 );
10297  </code>
10298  Remarks:
10299  This function implements an operation of the EnableControl feature.
10300  This feature may not be available on all devices. Please refer to the
10301  specific device data sheet to determine availability or use the
10302  PLIB_DMA_ExistsEnableControl function in your application to automatically
10303  determine whether this feature is available.
10304 */
10305 
10306 void
10308  DMA_MODULE_ID index ) ;
10309 // *****************************************************************************
10310 // *****************************************************************************
10311 // Section: DMA status functions
10312 // *****************************************************************************
10313 // *****************************************************************************
10314 //******************************************************************************
10315 /* Function:
10316  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10317  Summary:
10318  Returns the DMA channel bits.
10319  Description:
10320  This function returns the channel bits.
10321  Precondition:
10322  None.
10323  Parameters:
10324  None.
10325  Returns:
10326  - uint8_t - DMA channel bits
10327  Example:
10328  <code>
10329  uint8_t dmaChBits;
10330  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10331  </code>
10332  Remarks:
10333  This function implements an operation of the ChannelBits feature.
10334  This feature may not be available on all devices. Please refer to the
10335  specific device data sheet to determine availability or use the
10336  PLIB_DMA_ExistsChannelBits function in your application to automatically
10337  determine whether this feature is available.
10338 */
10339 
10340 uint8_t
10342  DMA_MODULE_ID index ) ;
10343 //******************************************************************************
10344 /* Function:
10345  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10346  Summary:
10347  Returns true if the last DMA bus access was a read.
10348  Description:
10349  This function returns true if the last DMA bus access was a read.
10350  Precondition:
10351  None.
10352  Parameters:
10353  None.
10354  Returns:
10355  - true - The last bus access was a read
10356  - false - The last bus access was not a read
10357  Example:
10358  <code>
10359  bool dmaLastBusAccessType;
10360  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10361  </code>
10362  Remarks:
10363  This function implements an operation of the LastBusAccess feature.
10364  This feature may not be available on all devices. Please refer to the
10365  specific device data sheet to determine availability or use the
10366  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10367  determine whether this feature is available.
10368 */
10369 
10370 bool
10372  DMA_MODULE_ID index ) ;
10373 //******************************************************************************
10374 /* Function:
10375  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10376  Summary:
10377  Returns true if the last DMA bus access was a write.
10378  Description:
10379  This function returns true if the last DMA bus access was a write operation.
10380  Precondition:
10381  None.
10382  Parameters:
10383  None.
10384  Returns:
10385  - true - The last bus access was a write operation
10386  - false - The last bus access was not a write operation
10387  Example:
10388  <code>
10389  bool dmaLastBusAccessType;
10390  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10391  </code>
10392  Remarks:
10393  This function implements an operation of the LastBusAccess feature.
10394  This feature may not be available on all devices. Please refer to the
10395  specific device data sheet to determine availability or use the
10396  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10397  determine whether this feature is available.
10398 */
10399 
10400 bool
10402  DMA_MODULE_ID index ) ;
10403 //******************************************************************************
10404 /* Function:
10405  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10406  Summary:
10407  Returns the address of the most recent DMA access.
10408  Description:
10409  This function returns the address of the most recent DMA access.
10410  Precondition:
10411  None.
10412  Parameters:
10413  None.
10414  Returns:
10415  - uint32_t - The most recent address accessed by the DMA
10416  Example:
10417  <code>
10418  uint32_t dmaLastAddressAccessed;
10419  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10420  </code>
10421  Remarks:
10422  This function implements an operation of the RecentAddress feature.
10423  This feature may not be available on all devices. Please refer to the
10424  specific device data sheet to determine availability or use the
10425  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10426  determine whether this feature is available.
10427 */
10428 
10429 uint32_t
10431  DMA_MODULE_ID index ) ;
10432 // *****************************************************************************
10433 // *****************************************************************************
10434 // Section: DMA Module CRC Feature Interface Functions
10435 // *****************************************************************************
10436 // *****************************************************************************
10437 //******************************************************************************
10438 /* Function:
10439  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10440  DMA_CHANNEL channel )
10441  Summary:
10442  Assigns the CRC to the specified DMA channel.
10443  Description:
10444  This function assigns the CRC feature to the specified channel.
10445  Precondition:
10446  None.
10447  Parameters:
10448  channel - One of the possible DMA channels listed by DMA_CHANNEL
10449  Returns:
10450  None.
10451  Example:
10452  <code>
10453  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10454  DMA_CHANNEL_5 );
10455  </code>
10456  Remarks:
10457  This function implements an operation of the CRCChannel feature.
10458  This feature may not be available on all devices. Please refer to the
10459  specific device data sheet to determine availability or use the
10460  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10461  determine whether this feature is available.
10462 */
10463 
10464 void
10466  DMA_MODULE_ID index ,
10467  DMA_CHANNEL channel ) ;
10468 //******************************************************************************
10469 /* Function:
10470  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10471  Summary:
10472  Returns the current DMA channel to which the CRC is assigned.
10473  Description:
10474  This function returns the current DMA channel to which the CRC is assigned.
10475  Precondition:
10476  None.
10477  Parameters:
10478  None.
10479  Returns:
10480  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10481  Example:
10482  <code>
10483  DMA_CHANNEL crcChannel;
10484  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10485  </code>
10486  Remarks:
10487  This function implements an operation of the CRCChannel feature.
10488  This feature may not be available on all devices. Please refer to the
10489  specific device data sheet to determine availability or use the
10490  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10491  determine whether this feature is available.
10492 */
10493 
10494 DMA_CHANNEL
10496  DMA_MODULE_ID index ) ;
10497 //******************************************************************************
10498 /* Function:
10499  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10500  DMA_CRC_TYPE CRCType )
10501  Summary:
10502  Selects the DMA module CRC feature type.
10503  Description:
10504  This function selects the DMA module CRC feature type. The CRC feature will
10505  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10506  checksum.
10507  Precondition:
10508  None.
10509  Parameters:
10510  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10511  Returns:
10512  None.
10513  Example:
10514  <code>
10515  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10516  DMA_CRC_IP_HEADER );
10517  </code>
10518  Remarks:
10519  This function implements an operation of the CRCType feature.
10520  This feature may not be available on all devices. Please refer to the
10521  specific device data sheet to determine availability or use the
10522  PLIB_DMA_ExistsCRCType function in your application to automatically
10523  determine whether this feature is available.
10524 */
10525 
10526 void
10528  DMA_MODULE_ID index ,
10529  DMA_CRC_TYPE CRCType ) ;
10530 //******************************************************************************
10531 /* Function:
10532  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10533  Summary:
10534  Gets the current DMA module CRC feature type.
10535  Description:
10536  This function gets the DMA module CRC feature type. The CRC feature will
10537  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10538  checksum.
10539  Precondition:
10540  None.
10541  Parameters:
10542  None.
10543  Returns:
10544  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10545  Example:
10546  <code>
10547  DMA_CRC_TYPE CRCType;
10548  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10549  </code>
10550  Remarks:
10551  This function implements an operation of the CRCType feature.
10552  This feature may not be available on all devices. Please refer to the
10553  specific device data sheet to determine availability or use the
10554  PLIB_DMA_ExistsCRCType function in your application to automatically
10555  determine whether this feature is available.
10556 */
10557 
10558 DMA_CRC_TYPE
10560  DMA_MODULE_ID index ) ;
10561 //******************************************************************************
10562 /* Function:
10563  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10564  Summary:
10565  Enables the CRC append mode.
10566  Description:
10567  This function enables the CRC append mode. The DMA transfers data from the source
10568  into the CRC, but not to the destination. When a block transfer completes, the
10569  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10570  Precondition:
10571  None.
10572  Parameters:
10573  None.
10574  Returns:
10575  None.
10576  Example:
10577  <code>
10578  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10579  </code>
10580  Remarks:
10581  This function implements an operation of the CRCAppendMode feature.
10582  This feature may not be available on all devices. Please refer to the
10583  specific device data sheet to determine availability or use the
10584  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10585  determine whether this feature is available.
10586 */
10587 
10588 void
10590  DMA_MODULE_ID index ) ;
10591 //******************************************************************************
10592 /* Function:
10593  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10594  Summary:
10595  Gets the enable status of the CRC append mode.
10596  Description:
10597  This function gets the enable status of the CRC append mode.
10598  Precondition:
10599  None.
10600  Parameters:
10601  None.
10602  Returns:
10603  - true - CRC append mode is enabled
10604  - false - CRC append mode is disabled
10605  Example:
10606  <code>
10607  bool DMAcrcAppendMode;
10608  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10609  </code>
10610  Remarks:
10611  This function implements an operation of the CRCAppendMode feature.
10612  This feature may not be available on all devices. Please refer to the
10613  specific device data sheet to determine availability or use the
10614  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10615  determine whether this feature is available.
10616 */
10617 
10618 bool
10620  DMA_MODULE_ID index ) ;
10621 //******************************************************************************
10622 /* Function:
10623  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10624  Summary:
10625  Disables the CRC append mode.
10626  Description:
10627  This function disables the CRC append mode. The DMA transfers data from the
10628  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10629  as it writes the data to the destination.
10630  Precondition:
10631  None.
10632  Parameters:
10633  None.
10634  Returns:
10635  None.
10636  Example:
10637  <code>
10638  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
10639  </code>
10640  Remarks:
10641  This function implements an operation of the CRCAppendMode feature.
10642  This feature may not be available on all devices. Please refer to the
10643  specific device data sheet to determine availability or use the
10644  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10645  determine whether this feature is available.
10646 */
10647 
10648 void
10650  DMA_MODULE_ID index ) ;
10651 //******************************************************************************
10652 /* Function:
10653  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
10654  Summary:
10655  Enables the DMA module CRC feature.
10656  Description:
10657  This function enables the DMA module CRC feature. The channel transfers are
10658  routed through the CRC.
10659  Precondition:
10660  None.
10661  Parameters:
10662  None.
10663  Returns:
10664  None.
10665  Example:
10666  <code>
10667  PLIB_DMA_CRCEnable( DMA_ID_0 );
10668  </code>
10669  Remarks:
10670  This function implements an operation of the CRC feature.
10671  This feature may not be available on all devices. Please refer to the
10672  specific device data sheet to determine availability or use the
10673  PLIB_DMA_ExistsCRC function in your application to automatically
10674  determine whether this feature is available.
10675 */
10676 
10677 void
10679  DMA_MODULE_ID index ) ;
10680 //******************************************************************************
10681 /* Function:
10682  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
10683  Summary:
10684  Gets the enable status of the CRC feature.
10685  Description:
10686  This function gets the enable status of the CRC feature.
10687  Precondition:
10688  None.
10689  Parameters:
10690  None.
10691  Returns:
10692  - true - The CRC feature is enabled
10693  - false - The CRC feature is disabled
10694  Example:
10695  <code>
10696  bool DMAcrcStatus;
10697  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
10698  </code>
10699  Remarks:
10700  This function implements an operation of the CRC feature.
10701  This feature may not be available on all devices. Please refer to the
10702  specific device data sheet to determine availability or use the
10703  PLIB_DMA_ExistsCRC function in your application to automatically
10704  determine whether this feature is available.
10705 */
10706 
10707 bool
10709  DMA_MODULE_ID index ) ;
10710 //******************************************************************************
10711 /* Function:
10712  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
10713  Summary:
10714  Disables the DMA module CRC feature.
10715  Description:
10716  This function disables the DMA module CRC feature. The channel transfers proceed
10717  normally.
10718  Precondition:
10719  None.
10720  Parameters:
10721  None.
10722  Returns:
10723  None.
10724  Example:
10725  <code>
10726  PLIB_DMA_CRCDisable( DMA_ID_0 );
10727  </code>
10728  Remarks:
10729  This function implements an operation of the CRC feature.
10730  This feature may not be available on all devices. Please refer to the
10731  specific device data sheet to determine availability or use the
10732  PLIB_DMA_ExistsCRC function in your application to automatically
10733  determine whether this feature is available.
10734 */
10735 
10736 void
10738  DMA_MODULE_ID index ) ;
10739 //******************************************************************************
10740 /* Function:
10741  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
10742  uint8_t polyLength )
10743  Summary:
10744  Selects the polynomial length.
10745  Description:
10746  This function Selects the polynomial length.
10747  Precondition:
10748  None.
10749  Parameters:
10750  polyLength - Polynomial length
10751  Returns:
10752  None.
10753  Example:
10754  <code>
10755  uint8_t polyLength = 0x2;
10756  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
10757  </code>
10758  Remarks:
10759  This function implements an operation of the CRCPolynomialLength feature.
10760  This feature may not be available on all devices. Please refer to the
10761  specific device data sheet to determine availability or use the
10762  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10763  determine whether this feature is available.
10764 */
10765 
10766 void
10768  DMA_MODULE_ID index ,
10769  uint8_t polyLength ) ;
10770 //******************************************************************************
10771 /* Function:
10772  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
10773  Summary:
10774  Gets the current polynomial length.
10775  Description:
10776  This function gets the current polynomial length.
10777  Precondition:
10778  None.
10779  Parameters:
10780  None.
10781  Returns:
10782  - uint8_t - Polynomial length
10783  Example:
10784  <code>
10785  uint8_t polyLength;
10786  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
10787  </code>
10788  Remarks:
10789  This function implements an operation of the CRCPolynomialLength feature.
10790  This feature may not be available on all devices. Please refer to the
10791  specific device data sheet to determine availability or use the
10792  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10793  determine whether this feature is available.
10794 */
10795 
10796 uint8_t
10798  DMA_MODULE_ID index ) ;
10799 //******************************************************************************
10800 /* Function:
10801  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
10802  DMA_CRC_BIT_ORDER bitOrder )
10803  Summary:
10804  Selects the bit order for checksum calculation.
10805  Description:
10806  This function selects the bit order for checksum calculation.
10807  Precondition:
10808  None.
10809  Parameters:
10810  bitOrder - Specifies the bit order for CRC calculation
10811  Returns:
10812  None.
10813  Example:
10814  <code>
10815  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
10816  </code>
10817  Remarks:
10818  This function implements an operation of the CRCBitOrder feature.
10819  This feature may not be available on all devices. Please refer to the
10820  specific device data sheet to determine availability or use the
10821  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
10822  determine whether this feature is available.
10823 */
10824 
10825 void
10827  DMA_MODULE_ID index ,
10828  DMA_CRC_BIT_ORDER bitOrder ) ;
10829 //******************************************************************************
10830 /* Function:
10831  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
10832  Summary:
10833  The source data is written to the destination reordered as defined by the
10834  BYTO<1:0> bits.
10835  Description:
10836  This function enables byte order alteration as specified by the BYTO<1:0> bits.
10837  The source data is written to the destination reordered as defined by the
10838  BYTO<1:0> bits.
10839  Precondition:
10840  None.
10841  Parameters:
10842  None.
10843  Returns:
10844  None.
10845  Example:
10846  <code>
10847  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
10848  </code>
10849  Remarks:
10850  This function implements an operation of the CRCWriteByteOrder feature.
10851  This feature may not be available on all devices. Please refer to the
10852  specific device data sheet to determine availability or use the
10853  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10854  determine whether this feature is available.
10855 */
10856 
10857 void
10859  DMA_MODULE_ID index ) ;
10860 //******************************************************************************
10861 /* Function:
10862  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
10863  Summary:
10864  The source data is written to the destination unaltered.
10865  Description:
10866  This function disables byte order alteration. The source data is written
10867  to the destination unaltered.
10868  Precondition:
10869  None.
10870  Parameters:
10871  None.
10872  Returns:
10873  None.
10874  Example:
10875  <code>
10876  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
10877  </code>
10878  Remarks:
10879  This function implements an operation of the CRCWriteByteOrder feature.
10880  This feature may not be available on all devices. Please refer to the
10881  specific device data sheet to determine availability or use the
10882  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10883  determine whether this feature is available.
10884 */
10885 
10886 void
10888  DMA_MODULE_ID index ) ;
10889 //******************************************************************************
10890 /* Function:
10891  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
10892  DMA_CRC_BYTE_ORDER byteOrder )
10893  Summary:
10894  Selects the byte order.
10895  Description:
10896  This function selects the byte order.
10897  Precondition:
10898  The WBO bit must be set to use this function.
10899  Parameters:
10900  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10901  Returns:
10902  None.
10903  Example:
10904  <code>
10905  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
10906  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
10907  </code>
10908  Remarks:
10909  This function implements an operation of the CRCByteOrder feature.
10910  This feature may not be available on all devices. Please refer to the
10911  specific device data sheet to determine availability or use the
10912  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10913  determine whether this feature is available.
10914 */
10915 
10916 void
10918  DMA_MODULE_ID index ,
10919  DMA_CRC_BYTE_ORDER byteOrder ) ;
10920 //******************************************************************************
10921 /* Function:
10922  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
10923  Summary:
10924  Gets the current byte order selected by the DMA module CRC feature.
10925  Description:
10926  This function gets the current byte order selected by the DMA module CRC feature.
10927  Precondition:
10928  The WBO bit must be set to use this function.
10929  Parameters:
10930  None.
10931  Returns:
10932  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10933  Example:
10934  <code>
10935  DMA_CRC_BYTE_ORDER byteOrder;
10936  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
10937  </code>
10938  Remarks:
10939  This function implements an operation of the CRCByteOrder feature.
10940  This feature may not be available on all devices. Please refer to the
10941  specific device data sheet to determine availability or use the
10942  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10943  determine whether this feature is available.
10944 */
10945 
10946 DMA_CRC_BYTE_ORDER
10948  DMA_MODULE_ID index ) ;
10949 //******************************************************************************
10950 /* Function:
10951  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
10952  Summary:
10953  Reads the contents of the DMA CRC data register.
10954  Description:
10955  This function reads the contents of the DMA CRC data register.
10956  Precondition:
10957  None.
10958  Parameters:
10959  None.
10960  Returns:
10961  - uint32_t - 32-bit CRC data
10962  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10963  device data sheet to determine availability.
10964  Example:
10965  <code>
10966  uint32_t DMACRCdata;
10967  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
10968  </code>
10969  Remarks:
10970  This function implements an operation of the CRCData feature.
10971  This feature may not be available on all devices. Please refer to the
10972  specific device data sheet to determine availability or use the
10973  PLIB_DMA_ExistsCRCData function in your application to automatically
10974  determine whether this feature is available.
10975 */
10976 
10977 uint32_t
10979  DMA_MODULE_ID index ) ;
10980 //******************************************************************************
10981 /* Function:
10982  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
10983  uint32_t DMACRCdata )
10984  Summary:
10985  Writes the contents of the DMA CRC data register with the specified data.
10986  Description:
10987  This function writes the contents of the DMA CRC data register.
10988  Precondition:
10989  None.
10990  Parameters:
10991  - DMACRCdata - 32-bit CRC data
10992  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10993  device data sheet to determine availability.
10994  Returns:
10995  None.
10996  Example:
10997  <code>
10998  uint32_t DMACRCdata = 0x0E0E0E;
10999  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
11000  </code>
11001  Remarks:
11002  This function implements an operation of the CRCData feature.
11003  This feature may not be available on all devices. Please refer to the
11004  specific device data sheet to determine availability or use the
11005  PLIB_DMA_ExistsCRCData function in your application to automatically
11006  determine whether this feature is available.
11007 */
11008 
11009 void
11011  DMA_MODULE_ID index ,
11012  uint32_t DMACRCdata ) ;
11013 //******************************************************************************
11014 /* Function:
11015  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
11016  Summary:
11017  Reads the CRC XOR register.
11018  Description:
11019  This function reads the CRC XOR register.
11020  Precondition:
11021  None.
11022  Parameters:
11023  None.
11024  Returns:
11025  - uint32_t - 32-bit CRC XOR enable mask data
11026  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11027  device data sheet to determine availability.
11028  Example:
11029  <code>
11030  uint32_t DMACRCXORdata;
11031  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
11032  </code>
11033  Remarks:
11034  This function implements an operation of the CRCXOREnable feature.
11035  This feature may not be available on all devices. Please refer to the
11036  specific device data sheet to determine availability or use the
11037  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
11038  determine whether this feature is available.
11039 */
11040 
11041 uint32_t
11043  DMA_MODULE_ID index ) ;
11044 //******************************************************************************
11045 /* Function:
11046  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
11047  uint32_t DMACRCXOREnableMask )
11048  Summary:
11049  Writes to the CRC XOR enable register as per the specified enable mask.
11050  Description:
11051  This function writes to the CRC XOR enable register as per the specified
11052  enable mask. Each enabled bit will be taken as input to the shift register.
11053  Precondition:
11054  None.
11055  Parameters:
11056  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
11057  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11058  device data sheet to determine availability.
11059  Returns:
11060  None.
11061  Example:
11062  <code>
11063  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
11064  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
11065  </code>
11066  Remarks:
11067  This function implements an operation of the CRCXOREnable feature.
11068  This feature may not be available on all devices. Please refer to the
11069  specific device data sheet to determine availability or use the
11070  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
11071  determine whether this feature is available.
11072 */
11073 
11074 void
11076  DMA_MODULE_ID index ,
11077  uint32_t DMACRCXOREnableMask ) ;
11078 // *****************************************************************************
11079 // *****************************************************************************
11080 // Section: DMA Address control Interface functions
11081 // *****************************************************************************
11082 // *****************************************************************************
11083 //******************************************************************************
11084 /* Function:
11085  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
11086  DMA_CHANNEL dmaChannel )
11087  Summary:
11088  Reads the source start address configured for the specified channel.
11089  Description:
11090  This function reads the source start address configured for the specified
11091  channel.
11092  Precondition:
11093  None.
11094  Parameters:
11095  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11096  Returns:
11097  - uint32_t - The source start address configured for this channel
11098  Example:
11099  <code>
11100  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11101  uint32_t SourceStartAddress;
11102  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11103  spiDMAChannel );
11104  </code>
11105  Remarks:
11106  This function implements an operation of the ChannelXSourceStartAddress feature.
11107  This feature may not be available on all devices. Please refer to the
11108  specific device data sheet to determine availability or use the
11109  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11110  determine whether this feature is available.
11111 */
11112 
11113 uint32_t
11115  DMA_MODULE_ID index ,
11116  DMA_CHANNEL dmaChannel ) ;
11117 //******************************************************************************
11118 /* Function:
11119  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11120  DMA_CHANNEL dmaChannel,
11121  uint32_t sourceStartAddress)
11122  Summary:
11123  Writes the specified source start address into the register
11124  corresponding to the specified channel.
11125  Description:
11126  This function writes the specified Source start address into the register
11127  corresponding to the specified channel.
11128  Precondition:
11129  None.
11130  Parameters:
11131  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11132  sourceStartAddress - The source start address
11133  Returns:
11134  None.
11135  Example:
11136  <code>
11137  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11138  uint32_t sourceStartAddress = 0x00FDEA00;
11139  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11140  spiDMAChannel,
11141  sourceStartAddress );
11142  </code>
11143  Remarks:
11144  This function implements an operation of the ChannelXSourceStartAddress feature.
11145  This feature may not be available on all devices. Please refer to the
11146  specific device data sheet to determine availability or use the
11147  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11148  determine whether this feature is available.
11149 */
11150 
11151 void
11153  DMA_MODULE_ID index ,
11154  DMA_CHANNEL dmaChannel ,
11155  uint32_t sourceStartAddress ) ;
11156 //******************************************************************************
11157 /* Function:
11158  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11159  DMA_CHANNEL dmaChannel )
11160  Summary:
11161  Reads the destination start address configured for the specified channel.
11162  Description:
11163  This function reads the destination start address configured for the specified
11164  channel.
11165  Precondition:
11166  None.
11167  Parameters:
11168  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11169  Returns:
11170  - uint32_t - The destination start address configured for this channel
11171  Example:
11172  <code>
11173  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11174  uint32_t DestinationStartAddress;
11175  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11176  DMA_ID_0,
11177  spiDMAChannel );
11178  </code>
11179  Remarks:
11180  This function implements an operation of the ChannelXDestinationStartAddress feature.
11181  This feature may not be available on all devices. Please refer to the
11182  specific device data sheet to determine availability or use the
11183  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11184  determine whether this feature is available.
11185 */
11186 
11187 uint32_t
11189  DMA_MODULE_ID index ,
11190  DMA_CHANNEL dmaChannel ) ;
11191 //******************************************************************************
11192 /* Function:
11193  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11194  DMA_MODULE_ID index,
11195  DMA_CHANNEL dmaChannel,
11196  uint32_t destinationStartAddress)
11197  Summary:
11198  Writes the specified destination start address into the register corresponding to
11199  the specified channel.
11200  Description:
11201  This function writes the specified destination start address into the register
11202  corresponding to the specified channel.
11203  Precondition:
11204  None.
11205  Parameters:
11206  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11207  destinationStartAddress - The destination start address
11208  Returns:
11209  None.
11210  Example:
11211  <code>
11212  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11213  uint32_t destinationStartAddress = 0x00FDEA00;
11214  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11215  spiDMAChannel,
11216  destinationStartAddress );
11217  </code>
11218  Remarks:
11219  This function implements an operation of the ChannelXDestinationStartAddress feature.
11220  This feature may not be available on all devices. Please refer to the
11221  specific device data sheet to determine availability or use the
11222  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11223  determine whether this feature is available.
11224 */
11225 
11226 void
11228  DMA_MODULE_ID index ,
11229  DMA_CHANNEL dmaChannel ,
11230  uint32_t destinationStartAddress ) ;
11231 // *****************************************************************************
11232 // *****************************************************************************
11233 // Section: DMA Data control Interface functions
11234 // *****************************************************************************
11235 // *****************************************************************************
11236 //******************************************************************************
11237 /* Function:
11238  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11239  DMA_CHANNEL dmaChannel )
11240  Summary:
11241  Reads the source size configured for the specified channel.
11242  Description:
11243  This function reads the source size configured for the specified
11244  channel.
11245  Precondition:
11246  None.
11247  Parameters:
11248  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11249  Returns:
11250  - uint16_t - The Source size configured (in bytes) for this channel.
11251  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11252  device data sheet to determine availability.
11253  Example:
11254  <code>
11255  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11256  uint16_t sourceSize;
11257  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11258  spiDMAChannel );
11259  </code>
11260  Remarks:
11261  This function implements an operation of the ChannelXSourceSize feature.
11262  This feature may not be available on all devices. Please refer to the
11263  specific device data sheet to determine availability or use the
11264  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11265  determine whether this feature is available.
11266 */
11267 
11268 uint16_t
11270  DMA_MODULE_ID index ,
11271  DMA_CHANNEL dmaChannel ) ;
11272 //******************************************************************************
11273 /* Function:
11274  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11275  DMA_CHANNEL dmaChannel,
11276  uint16_t sourceSize)
11277  Summary:
11278  Writes the specified source size into the register corresponding
11279  to the specified channel.
11280  Description:
11281  This function writes the specified source size into the register
11282  corresponding to the specified channel.
11283  Precondition:
11284  None.
11285  Parameters:
11286  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11287  sourceSize - The source size. The source size (8-bit, 16-bit) is
11288  device-specific. Please refer to the specific device data
11289  sheet to determine availability.
11290  Returns:
11291  None.
11292  Example:
11293  <code>
11294  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11295  uint16_t sourceSize = 0xA00;
11296  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11297  spiDMAChannel,
11298  sourceSize );
11299  </code>
11300  Remarks:
11301  This function implements an operation of the ChannelXSourceSize feature.
11302  This feature may not be available on all devices. Please refer to the
11303  specific device data sheet to determine availability or use the
11304  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11305  determine whether this feature is available.
11306 */
11307 
11308 void
11310  DMA_MODULE_ID index ,
11311  DMA_CHANNEL dmaChannel ,
11312  uint16_t sourceSize ) ;
11313 //******************************************************************************
11314 /* Function:
11315  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11316  DMA_CHANNEL dmaChannel )
11317  Summary:
11318  Reads the destination size configured for the specified channel.
11319  Description:
11320  This function reads the destination size configured for the specified
11321  channel.
11322  Precondition:
11323  None.
11324  Parameters:
11325  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11326  Returns:
11327  - uint16_t - The destination size configured (in bytes) for this channel.
11328  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11329  device data sheet to determine availability.
11330  Example:
11331  <code>
11332  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11333  uint16_t DestinationSize;
11334  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11335  spiDMAChannel );
11336  </code>
11337  Remarks:
11338  This function implements an operation of the ChannelXDestinationSize feature.
11339  This feature may not be available on all devices. Please refer to the
11340  specific device data sheet to determine availability or use the
11341  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11342  determine whether this feature is available.
11343 */
11344 
11345 uint16_t
11347  DMA_MODULE_ID index ,
11348  DMA_CHANNEL dmaChannel ) ;
11349 //******************************************************************************
11350 /* Function:
11351  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11352  DMA_CHANNEL dmaChannel,
11353  uint16_t destinationSize)
11354  Summary:
11355  Writes the specified destination size into the register corresponding
11356  to the specified channel.
11357  Description:
11358  This function writes the specified destination size into the register
11359  corresponding to the specified channel.
11360  Precondition:
11361  None.
11362  Parameters:
11363  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11364  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11365  is device-specific. Please refer to the specific device
11366  data sheet to determine availability.)
11367  Returns:
11368  None.
11369  Example:
11370  <code>
11371  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11372  uint16_t destinationSize = 0xA00;
11373  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11374  </code>
11375  Remarks:
11376  This function implements an operation of the ChannelXDestinationSize feature.
11377  This feature may not be available on all devices. Please refer to the
11378  specific device data sheet to determine availability or use the
11379  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11380  determine whether this feature is available.
11381 */
11382 
11383 void
11385  DMA_MODULE_ID index ,
11386  DMA_CHANNEL dmaChannel ,
11387  uint16_t destinationSize ) ;
11388 //******************************************************************************
11389 /* Function:
11390  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11391  DMA_CHANNEL dmaChannel )
11392  Summary:
11393  Reads the current byte of the source being pointed to for the specified channel.
11394  Description:
11395  This function reads the current byte of the source being pointed to for the
11396  specified channel.
11397  Precondition:
11398  None.
11399  Parameters:
11400  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11401  Returns:
11402  - uint16_t - The source byte being pointed to for this channel.
11403  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11404  device data sheet to determine availability.
11405  Example:
11406  <code>
11407  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11408  uint16_t sourcebyte;
11409  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11410  </code>
11411  Remarks:
11412  This function implements an operation of the ChannelXSourcePointer feature.
11413  This feature may not be available on all devices. Please refer to the
11414  specific device data sheet to determine availability or use the
11415  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11416  determine whether this feature is available.
11417 */
11418 
11419 uint16_t
11421  DMA_MODULE_ID index ,
11422  DMA_CHANNEL dmaChannel ) ;
11423 //******************************************************************************
11424 /* Function:
11425  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11426  DMA_CHANNEL dmaChannel )
11427  Summary:
11428  Reads the current byte of the destination being pointed to for the specified channel.
11429  Description:
11430  This function reads the current byte of the destination being pointed to for the
11431  specified channel.
11432  Precondition:
11433  None.
11434  Parameters:
11435  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11436  Returns:
11437  - uint16_t - The destination byte being pointed to for this channel.
11438  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11439  device data sheet to determine availability.
11440  Example:
11441  <code>
11442  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11443  uint16_t destinationbyte;
11444  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11445  spiDMAChannel );
11446  </code>
11447  Remarks:
11448  This function implements an operation of the ChannelXDestinationPointer feature.
11449  This feature may not be available on all devices. Please refer to the
11450  specific device data sheet to determine availability or use the
11451  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11452  determine whether this feature is available.
11453 */
11454 
11455 uint16_t
11457  DMA_MODULE_ID index ,
11458  DMA_CHANNEL dmaChannel ) ;
11459 //******************************************************************************
11460 /* Function:
11461  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11462  DMA_CHANNEL dmaChannel )
11463  Summary:
11464  Reads the cell size (in bytes) configured for the specified channel.
11465  Description:
11466  This function reads the cell size (in bytes) configured for the specified
11467  channel.
11468  Precondition:
11469  None.
11470  Parameters:
11471  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11472  Returns:
11473  - uint16_t - The cell size configured (in bytes) for this channel
11474  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11475  device data sheet to determine availability.
11476  Example:
11477  <code>
11478  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11479  uint16_t cellSize;
11480  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11481  spiDMAChannel );
11482  </code>
11483  Remarks:
11484  This function implements an operation of the ChannelXCellSize feature.
11485  This feature may not be available on all devices. Please refer to the
11486  specific device data sheet to determine availability or use the
11487  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11488  determine whether this feature is available.
11489 */
11490 
11491 uint16_t
11493  DMA_MODULE_ID index ,
11494  DMA_CHANNEL dmaChannel ) ;
11495 //******************************************************************************
11496 /* Function:
11497  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11498  DMA_CHANNEL dmaChannel,
11499  uint16_t cellSize)
11500  Summary:
11501  Writes the specified cell size into the register corresponding
11502  to the specified channel.
11503  Description:
11504  This function writes the specified cell size into the register
11505  corresponding to the specified channel.
11506  Precondition:
11507  None.
11508  Parameters:
11509  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11510  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11511  device-specific. Please refer to the specific device data
11512  sheet to determine availability.)
11513  Returns:
11514  None.
11515  Example:
11516  <code>
11517  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11518  uint16_t cellSize = 0x10;
11519  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11520  </code>
11521  Remarks:
11522  This function implements an operation of the ChannelXCellSize feature.
11523  This feature may not be available on all devices. Please refer to the
11524  specific device data sheet to determine availability or use the
11525  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11526  determine whether this feature is available.
11527 */
11528 
11529 void
11531  DMA_MODULE_ID index ,
11532  DMA_CHANNEL dmaChannel ,
11533  uint16_t CellSize ) ;
11534 //******************************************************************************
11535 /* Function:
11536  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11537  DMA_CHANNEL dmaChannel )
11538  Summary:
11539  Returns the number of bytes transferred since the last event.
11540  Description:
11541  This function returns the number of bytes transferred since the last event.
11542  Precondition:
11543  None.
11544  Parameters:
11545  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11546  Returns:
11547  - uint16_t - The number of bytes transferred since the last event.
11548  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11549  the specific device data sheet to determine availability.
11550  Example:
11551  <code>
11552  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11553  uint16_t CellProgress;
11554  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11555  spiDMAChannel );
11556  </code>
11557  Remarks:
11558  This function implements an operation of the ChannelXCellProgressPointer feature.
11559  This feature may not be available on all devices. Please refer to the
11560  specific device data sheet to determine availability or use the
11561  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11562  determine whether this feature is available.
11563 */
11564 
11565 uint16_t
11567  DMA_MODULE_ID index ,
11568  DMA_CHANNEL dmaChannel ) ;
11569 //******************************************************************************
11570 /* Function:
11571  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11572  DMA_CHANNEL dmaChannel )
11573  Summary:
11574  Returns the pattern matching (for DMA abort) data programmed for the specified
11575  channel.
11576  Description:
11577  This function returns pattern matching (for DMA abort) data programmed for
11578  the specified channel.
11579  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11580  the specific device data sheet to determine availability.)
11581  Precondition:
11582  None.
11583  Parameters:
11584  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11585  Returns:
11586  - uint16_t - The pattern matching data programmed for the current channel.
11587  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11588  the specific device data sheet to determine availability.
11589  Example:
11590  <code>
11591  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11592  uint16_t patternData;
11593  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11594  </code>
11595  Remarks:
11596  This function implements an operation of the ChannelXPatternData feature.
11597  This feature may not be available on all devices. Please refer to the
11598  specific device data sheet to determine availability or use the
11599  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11600  determine whether this feature is available.
11601 */
11602 
11603 uint16_t
11605  DMA_MODULE_ID index ,
11606  DMA_CHANNEL dmaChannel ) ;
11607 //******************************************************************************
11608 /* Function:
11609  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11610  DMA_CHANNEL dmaChannel,
11611  uint16_t patternData)
11612  Summary:
11613  Writes the specified pattern matching data (for DMA abort) into the register
11614  corresponding to the specified channel.
11615  Description:
11616  This function writes the specified pattern matching data (for DMA abort) into the
11617  register corresponding to the specified channel.
11618  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11619  the specific device data sheet to determine availability.)
11620  Precondition:
11621  None.
11622  Parameters:
11623  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11624  patternData - The pattern matching DATA programmed for the current channel
11625  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11626  the specific device data sheet to determine availability.)
11627  Returns:
11628  None.
11629  Example:
11630  <code>
11631  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11632  uint16_t patternData = '\0';
11633  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
11634  </code>
11635  Remarks:
11636  This function implements an operation of the ChannelXPatternData feature.
11637  This feature may not be available on all devices. Please refer to the
11638  specific device data sheet to determine availability or use the
11639  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11640  determine whether this feature is available.
11641 */
11642 
11643 void
11645  DMA_MODULE_ID index ,
11646  DMA_CHANNEL dmaChannel ,
11647  uint16_t patternData ) ;
11648 // *****************************************************************************
11649 // *****************************************************************************
11650 // Section: DMA Interrupt Control Interface functions
11651 // *****************************************************************************
11652 // *****************************************************************************
11653 //******************************************************************************
11654 /* Function:
11655  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
11656  DMA_CHANNEL dmaChannel,
11657  DMA_INT_TYPE dmaINTSource )
11658  Summary:
11659  Returns the status of the interrupt flag of the specified DMA interrupt source
11660  for the specified channel.
11661  Description:
11662  This function returns the status of the interrupt flag of the specified DMA interrupt
11663  source for the specified channel.
11664  Precondition:
11665  None.
11666  Parameters:
11667  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11668  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11669  Returns:
11670  - true - The interrupt flag is set
11671  - false - The interrupt flag is not set
11672  Example:
11673  <code>
11674  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11675  bool AddressErrorINTStatus;
11676  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
11677  DMA_ID_0,
11678  spiDMAChannel,
11679  DMA_INT_ADDRESS_ERROR );
11680  </code>
11681  Remarks:
11682  This function implements an operation of the ChannelXINTSourceFlag feature.
11683  This feature may not be available on all devices. Please refer to the
11684  specific device data sheet to determine availability or use the
11685  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11686  determine whether this feature is available.
11687 */
11688 
11689 bool
11691  DMA_MODULE_ID index ,
11692  DMA_CHANNEL dmaChannel ,
11693  DMA_INT_TYPE dmaINTSource ) ;
11694 //******************************************************************************
11695 /* Function:
11696  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
11697  DMA_CHANNEL dmaChannel,
11698  DMA_INT_TYPE dmaINTSource )
11699  Summary:
11700  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
11701  Description:
11702  This function sets the interrupt flag of the specified DMA interrupt source for
11703  the specified channel.
11704  Precondition:
11705  None.
11706  Parameters:
11707  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11708  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11709  Returns:
11710  None.
11711  Example:
11712  <code>
11713  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11714  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
11715  spiDMAChannel,
11716  DMA_INT_ADDRESS_ERROR );
11717  </code>
11718  Remarks:
11719  This function implements an operation of the ChannelXINTSourceFlag feature.
11720  This feature may not be available on all devices. Please refer to the
11721  specific device data sheet to determine availability or use the
11722  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11723  determine whether this feature is available.
11724 */
11725 
11726 void
11728  DMA_MODULE_ID index ,
11729  DMA_CHANNEL dmaChannel ,
11730  DMA_INT_TYPE dmaINTSource ) ;
11731 //******************************************************************************
11732 /* Function:
11733  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
11734  DMA_CHANNEL dmaChannel,
11735  DMA_INT_TYPE dmaINTSource )
11736  Summary:
11737  Clears the interrupt flag of the specified DMA interrupt source
11738  for the specified channel.
11739  Description:
11740  This function clears the interrupt flag of the specified DMA interrupt source
11741  for the specified channel.
11742  Precondition:
11743  None.
11744  Parameters:
11745  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11746  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11747  Returns:
11748  None.
11749  Example:
11750  <code>
11751  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11752  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
11753  spiDMAChannel,
11754  DMA_INT_ADDRESS_ERROR );
11755  </code>
11756  Remarks:
11757  This function implements an operation of the ChannelXINTSourceFlag feature.
11758  This feature may not be available on all devices. Please refer to the
11759  specific device data sheet to determine availability or use the
11760  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11761  determine whether this feature is available.
11762 */
11763 
11764 void
11766  DMA_MODULE_ID index ,
11767  DMA_CHANNEL dmaChannel ,
11768  DMA_INT_TYPE dmaINTSource ) ;
11769 //******************************************************************************
11770 /* Function:
11771  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
11772  DMA_CHANNEL dmaChannel,
11773  DMA_INT_TYPE dmaINTSource )
11774  Summary:
11775  Enables the specified interrupt source for the specified channel.
11776  Description:
11777  This function enables the specified interrupt source for the specified channel.
11778  Precondition:
11779  None.
11780  Parameters:
11781  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11782  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11783  Returns:
11784  None.
11785  Example:
11786  <code>
11787  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11788  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
11789  spiDMAChannel,
11790  DMA_INT_ADDRESS_ERROR );
11791  </code>
11792  Remarks:
11793  This function implements an operation of the ChannelXINTSource feature.
11794  This feature may not be available on all devices. Please refer to the
11795  specific device data sheet to determine availability or use the
11796  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11797  determine whether this feature is available.
11798 */
11799 
11800 void
11802  DMA_MODULE_ID index ,
11803  DMA_CHANNEL dmaChannel ,
11804  DMA_INT_TYPE dmaINTSource ) ;
11805 //******************************************************************************
11806 /* Function:
11807  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
11808  DMA_CHANNEL dmaChannel,
11809  DMA_INT_TYPE dmaINTSource )
11810  Summary:
11811  Disables the specified interrupt source for the specified channel.
11812  Description:
11813  This function disables the specified interrupt source for the specified channel.
11814  Precondition:
11815  None.
11816  Parameters:
11817  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11818  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11819  Returns:
11820  None.
11821  Example:
11822  <code>
11823  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11824  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
11825  spiDMAChannel,
11826  DMA_INT_ADDRESS_ERROR );
11827  </code>
11828  Remarks:
11829  This function implements an operation of the ChannelXINTSource feature.
11830  This feature may not be available on all devices. Please refer to the
11831  specific device data sheet to determine availability or use the
11832  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11833  determine whether this feature is available.
11834 */
11835 
11836 void
11838  DMA_MODULE_ID index ,
11839  DMA_CHANNEL dmaChannel ,
11840  DMA_INT_TYPE dmaINTSource ) ;
11841 //******************************************************************************
11842 /* Function:
11843  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
11844  DMA_CHANNEL dmaChannel,
11845  DMA_INT_TYPE dmaINTSource )
11846  Summary:
11847  Returns the enable status of the specified interrupt source for the specified channel.
11848  Description:
11849  This function returns the enable status of the specified interrupt source for the
11850  specified channel.
11851  Precondition:
11852  None.
11853  Parameters:
11854  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11855  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11856  Returns:
11857  - true - The interrupt is enabled
11858  - false - The interrupt is not enabled
11859  Example:
11860  <code>
11861  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11862  bool dmaINTSourceEnableStatus;
11863  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
11864  DMA_ID_0,
11865  spiDMAChannel,
11866  DMA_INT_ADDRESS_ERROR );
11867  </code>
11868  Remarks:
11869  This function implements an operation of the ChannelXINTSource feature.
11870  This feature may not be available on all devices. Please refer to the
11871  specific device data sheet to determine availability or use the
11872  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11873  determine whether this feature is available.
11874 */
11875 
11876 bool
11878  DMA_MODULE_ID index ,
11879  DMA_CHANNEL dmaChannel ,
11880  DMA_INT_TYPE dmaINTSource ) ;
11881 //******************************************************************************
11882 /* Function:
11883  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
11884  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
11885  Summary:
11886  Sets the pattern match length.
11887  Description:
11888  This function sets the length of the pattern match ignore to 1 or 2 bytes.
11889  Precondition:
11890  None.
11891  Parameters:
11892  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11893  patternLen - Length of pattern match (either 1 or 2)
11894  Returns:
11895  None.
11896  Example:
11897  <code>
11898  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11899  DMA_PATTERN_LENGTH patternLen;
11900  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
11901  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
11902  </code>
11903  Remarks:
11904  This function implements an operation of the ChannelXPatternLength feature.
11905  This feature may not be available on all devices. Please refer to the
11906  specific device data sheet to determine availability or use the
11907  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11908  determine whether this feature is available.
11909 */
11910 
11911 void
11913  DMA_MODULE_ID index ,
11914  DMA_CHANNEL dmaChannel ,
11915  DMA_PATTERN_LENGTH patternLen ) ;
11916 //******************************************************************************
11917 /* Function:
11918  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
11919  DMA_CHANNEL dmaChannel);
11920  Summary:
11921  Returns the pattern match length.
11922  Description:
11923  This function returns the length of the byte matching the CHPIGN bits during a
11924  pattern match that may be ignored during the pattern match determination when
11925  the CHPIGNEN bit is set.
11926  Precondition:
11927  None.
11928  Parameters:
11929  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11930  Returns:
11931  - patternLen - Length of pattern match (either 1 or 2)
11932  Example:
11933  <code>
11934  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11935  DMA_PATTERN_LENGTH patternLen;
11936  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
11937  </code>
11938  Remarks:
11939  This function implements an operation of the ChannelXPatternLength feature.
11940  This feature may not be available on all devices. Please refer to the
11941  specific device data sheet to determine availability or use the
11942  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11943  determine whether this feature is available.
11944 */
11945 
11946 DMA_PATTERN_LENGTH
11948  DMA_MODULE_ID index ,
11949  DMA_CHANNEL dmaChannel ) ;
11950 //******************************************************************************
11951 /* Function:
11952  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
11953  DMA_CHANNEL channel );
11954  Summary:
11955  Enables the pattern match ignore byte.
11956  Description:
11957  This function enables the pattern match ignore byte.
11958  Precondition:
11959  None.
11960  Parameters:
11961  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11962  Returns:
11963  None.
11964  Example:
11965  <code>
11966  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11967  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
11968  </code>
11969  Remarks:
11970  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11971  This feature may not be available on all devices. Please refer to the
11972  specific device data sheet to determine availability or use the
11973  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11974  determine whether this feature is available.
11975 */
11976 
11977 void
11979  DMA_MODULE_ID index ,
11980  DMA_CHANNEL channel ) ;
11981 //******************************************************************************
11982 /* Function:
11983  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
11984  DMA_CHANNEL channel );
11985  Summary:
11986  Returns the state of the pattern match ignore byte.
11987  Description:
11988  This function returns the state (enabled or disabled) of the pattern match
11989  ignore byte.
11990  Precondition:
11991  None.
11992  Parameters:
11993  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11994  Returns:
11995  - true - The pattern match ignore byte is enabled
11996  - false - The pattern match ignore byte is disabled
11997  Example:
11998  <code>
11999  bool patternIsEnabled;
12000  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12001  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
12002  </code>
12003  Remarks:
12004  This function implements an operation of the ChannelXPatternIgnoreByte feature.
12005  This feature may not be available on all devices. Please refer to the
12006  specific device data sheet to determine availability or use the
12007  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
12008  determine whether this feature is available.
12009 */
12010 
12011 bool
12013  DMA_MODULE_ID index ,
12014  DMA_CHANNEL channel ) ;
12015 //******************************************************************************
12016 /* Function:
12017  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
12018  DMA_CHANNEL channel );
12019  Summary:
12020  Disables the pattern match ignore byte.
12021  Description:
12022  This function disables the pattern match ignore byte.
12023  Precondition:
12024  None.
12025  Parameters:
12026  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12027  Returns:
12028  None.
12029  Example:
12030  <code>
12031  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12032  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
12033  </code>
12034  Remarks:
12035  This function implements an operation of the ChannelXPatternIgnoreByte feature.
12036  This feature may not be available on all devices. Please refer to the
12037  specific device data sheet to determine availability or use the
12038  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
12039  determine whether this feature is available.
12040 */
12041 
12042 void
12044  DMA_MODULE_ID index ,
12045  DMA_CHANNEL channel ) ;
12046 //******************************************************************************
12047 /* Function:
12048  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
12049  DMA_CHANNEL channel, uint8_t pattern );
12050  Summary:
12051  Sets the pattern match ignore value.
12052  Description:
12053  This function sets the value of the pattern match ignore.
12054  Precondition:
12055  None.
12056  Parameters:
12057  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12058  pattern - Pattern match ignore value
12059  Returns:
12060  None.
12061  Example:
12062  <code>
12063  uint8_t patternMatch = 0x8;
12064  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12065  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
12066  </code>
12067  Remarks:
12068  This function implements an operation of the ChannelXPatternIgnore feature.
12069  This feature may not be available on all devices. Please refer to the
12070  specific device data sheet to determine availability or use the
12071  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12072  determine whether this feature is available.
12073 */
12074 
12075 void
12077  DMA_MODULE_ID index ,
12078  DMA_CHANNEL channel ,
12079  uint8_t pattern ) ;
12080 //******************************************************************************
12081 /* Function:
12082  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
12083  DMA_CHANNEL channel );
12084  Summary:
12085  Returns the pattern match ignore value.
12086  Description:
12087  This function returns the value of the pattern match ignore.
12088  Precondition:
12089  None.
12090  Parameters:
12091  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12092  Returns:
12093  - uint8_t - Pattern match ignore value
12094  Example:
12095  <code>
12096  uint8_t patternMatch;
12097  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12098  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12099  </code>
12100  Remarks:
12101  This function implements an operation of the ChannelXPatternIgnore feature.
12102  This feature may not be available on all devices. Please refer to the
12103  specific device data sheet to determine availability or use the
12104  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12105  determine whether this feature is available.
12106 */
12107 
12108 uint8_t
12110  DMA_MODULE_ID index ,
12111  DMA_CHANNEL channel ) ;
12112 // *****************************************************************************
12113 // *****************************************************************************
12114 // Section: DMA Peripheral Library Exists API Routines
12115 // *****************************************************************************
12116 // *****************************************************************************
12117 /* The following functions indicate the existence of the features on the device.
12118 */
12119 //******************************************************************************
12120 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12121  Summary:
12122  Identifies whether the Busy feature exists on the DMA module.
12123  Description:
12124  This function identifies whether the Busy feature is available on the
12125  DMA module.
12126  When this function returns true, these functions are supported on the device:
12127  - PLIB_DMA_BusyActiveSet
12128  - PLIB_DMA_BusyActiveReset
12129  - PLIB_DMA_IsBusy
12130  Preconditions:
12131  None.
12132  Parameters:
12133  index - Identifier for the device instance
12134  Returns:
12135  - true - The Busy feature is supported on the device
12136  - false - The Busy feature is not supported on the device
12137  Remarks:
12138  None.
12139 */
12140 
12141 bool
12143  DMA_MODULE_ID index ) ;
12144 //******************************************************************************
12145 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12146  Summary:
12147  Identifies whether the Suspend feature exists on the DMA module.
12148  Description:
12149  This function identifies whether the Suspend feature is available on the
12150  DMA module.
12151  When this function returns true, these functions are supported on the device:
12152  - PLIB_DMA_SuspendEnable
12153  - PLIB_DMA_SuspendDisable
12154  - PLIB_DMA_SuspendIsEnabled
12155  Preconditions:
12156  None.
12157  Parameters:
12158  index - Identifier for the device instance
12159  Returns:
12160  - true - The Suspend feature is supported on the device
12161  - false - The Suspend feature is not supported on the device
12162  Remarks:
12163  None.
12164 */
12165 
12166 bool
12168  DMA_MODULE_ID index ) ;
12169 //******************************************************************************
12170 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12171  Summary:
12172  Identifies whether the StopInIdle feature exists on the DMA module.
12173  Description:
12174  This function identifies whether the StopInIdle feature is available on the
12175  DMA module.
12176  When this function returns true, these functions are supported on the device:
12177  - PLIB_DMA_StopInIdleEnable
12178  - PLIB_DMA_StopInIdleDisable
12179  Preconditions:
12180  None.
12181  Parameters:
12182  index - Identifier for the device instance
12183  Returns:
12184  - true - The StopInIdle feature is supported on the device
12185  - false - The StopInIdle feature is not supported on the device
12186  Remarks:
12187  None.
12188 */
12189 
12190 bool
12192  DMA_MODULE_ID index ) ;
12193 //******************************************************************************
12194 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12195  Summary:
12196  Identifies whether the EnableControl feature exists on the DMA module.
12197  Description:
12198  This function identifies whether the EnableControl feature is available on
12199  the DMA module.
12200  When this function returns true, these functions are supported on the device:
12201  - PLIB_DMA_Enable
12202  - PLIB_DMA_Disable
12203  - PLIB_DMA_IsEnabled
12204  Preconditions:
12205  None.
12206  Parameters:
12207  index - Identifier for the device instance
12208  Returns:
12209  - true - The EnableControl feature is supported on the device
12210  - false - The EnableControl feature is not supported on the device
12211  Remarks:
12212  None.
12213 */
12214 
12215 bool
12217  DMA_MODULE_ID index ) ;
12218 //******************************************************************************
12219 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12220  Summary:
12221  Identifies whether the ChannelBits feature exists on the DMA module.
12222  Description:
12223  This function identifies whether the ChannelBits feature is available on the
12224  DMA module.
12225  When this function returns true, this function is supported on the device:
12226  - PLIB_DMA_ChannelBitsGet
12227  Preconditions:
12228  None.
12229  Parameters:
12230  index - Identifier for the device instance
12231  Returns:
12232  - true - The ChannelBits feature is supported on the device
12233  - false - The ChannelBits feature is not supported on the device
12234  Remarks:
12235  None.
12236 */
12237 
12238 bool
12240  DMA_MODULE_ID index ) ;
12241 //******************************************************************************
12242 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12243  Summary:
12244  Identifies whether the LastBusAccess feature exists on the DMA module.
12245  Description:
12246  This function identifies whether the LastBusAccess feature is available on the
12247  DMA module.
12248  When this function returns true, these functions are supported on the device:
12249  - PLIB_DMA_LastBusAccessIsRead
12250  - PLIB_DMA_LastBusAccessIsWrite
12251  Preconditions:
12252  None.
12253  Parameters:
12254  index - Identifier for the device instance
12255  Returns:
12256  - true - The LastBusAccess feature is supported on the device
12257  - false - The LastBusAccess feature is not supported on the device
12258  Remarks:
12259  None.
12260 */
12261 
12262 bool
12264  DMA_MODULE_ID index ) ;
12265 //******************************************************************************
12266 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12267  Summary:
12268  Identifies whether the RecentAddress feature exists on the DMA module.
12269  Description:
12270  This function identifies whether the RecentAddress feature is available on
12271  the DMA module.
12272  When this function returns true, this function is supported on the device:
12273  - PLIB_DMA_RecentAddressAccessed
12274  Preconditions:
12275  None.
12276  Parameters:
12277  index - Identifier for the device instance
12278  Returns:
12279  - true - The RecentAddress feature is supported on the device
12280  - false - The RecentAddress feature is not supported on the device
12281  Remarks:
12282  None.
12283 */
12284 
12285 bool
12287  DMA_MODULE_ID index ) ;
12288 //******************************************************************************
12289 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12290  Summary:
12291  Identifies whether the CRCChannel feature exists on the DMA module.
12292  Description:
12293  This function identifies whether the CRCChannel feature is available on the
12294  DMA module.
12295  When this function returns true, these functions are supported on the device:
12296  - PLIB_DMA_CRCChannelSelect
12297  - PLIB_DMA_CRCChannelGet
12298  Preconditions:
12299  None.
12300  Parameters:
12301  index - Identifier for the device instance
12302  Returns:
12303  - true - The CRCChannel feature is supported on the device
12304  - false - The CRCChannel feature is not supported on the device
12305  Remarks:
12306  None.
12307 */
12308 
12309 bool
12311  DMA_MODULE_ID index ) ;
12312 //******************************************************************************
12313 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12314  Summary:
12315  Identifies whether the CRCType feature exists on the DMA module.
12316  Description:
12317  This function identifies whether the CRCType feature is available on the
12318  DMA module.
12319  When this function returns true, these functions are supported on the device:
12320  - PLIB_DMA_CRCTypeGet
12321  - PLIB_DMA_CRCTypeSet
12322  Preconditions:
12323  None.
12324  Parameters:
12325  index - Identifier for the device instance
12326  Returns:
12327  - true - The CRCType feature is supported on the device
12328  - false - The CRCType feature is not supported on the device
12329  Remarks:
12330  None.
12331 */
12332 
12333 bool
12335  DMA_MODULE_ID index ) ;
12336 //******************************************************************************
12337 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12338  Summary:
12339  Identifies whether the CRCAppendMode feature exists on the DMA module.
12340  Description:
12341  This function identifies whether the CRCAppendMode feature is available on
12342  the DMA module.
12343  When this function returns true, these functions are supported on the device:
12344  - PLIB_DMA_CRCAppendModeEnable
12345  - PLIB_DMA_CRCAppendModeDisable
12346  - PLIB_DMA_CRCAppendModeIsEnabled
12347  Preconditions:
12348  None.
12349  Parameters:
12350  index - Identifier for the device instance
12351  Returns:
12352  - true - The CRCAppendMode feature is supported on the device
12353  - false - The CRCAppendMode feature is not supported on the device
12354  Remarks:
12355  None.
12356 */
12357 
12358 bool
12360  DMA_MODULE_ID index ) ;
12361 //******************************************************************************
12362 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12363  Summary:
12364  Identifies whether the CRC feature exists on the DMA module.
12365  Description:
12366  This function identifies whether the CRC feature is available on the DMA module.
12367  When this function returns true, these functions are supported on the device:
12368  - PLIB_DMA_CRCEnable
12369  - PLIB_DMA_CRCDisable
12370  - PLIB_DMA_CRCIsEnabled
12371  Preconditions:
12372  None.
12373  Parameters:
12374  index - Identifier for the device instance
12375  Returns:
12376  - true - The CRC feature is supported on the device
12377  - false - The CRC feature is not supported on the device
12378  Remarks:
12379  None.
12380 */
12381 
12382 bool
12384  DMA_MODULE_ID index ) ;
12385 //******************************************************************************
12386 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12387  Summary:
12388  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12389  Description:
12390  This function identifies whether the CRCPolynomialLength feature is available
12391  on the DMA module.
12392  When this function returns true, these functions are supported on the device:
12393  - PLIB_DMA_CRCPolynomialLengthSet
12394  - PLIB_DMA_CRCPolynomialLengthGet
12395  Preconditions:
12396  None.
12397  Parameters:
12398  index - Identifier for the device instance
12399  Returns:
12400  - true - The CRCPolynomialLength feature is supported on the device
12401  - false - The CRCPolynomialLength feature is not supported on the device
12402  Remarks:
12403  None.
12404 */
12405 
12406 bool
12408  DMA_MODULE_ID index ) ;
12409 //******************************************************************************
12410 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12411  Summary:
12412  Identifies whether the CRCBitOrder feature exists on the DMA module.
12413  Description:
12414  This function identifies whether the CRCBitOrder feature is available on the
12415  DMA module.
12416  When this function returns true, this function is supported on the device:
12417  - PLIB_DMA_CRCBitOrderSelect
12418  Preconditions:
12419  None.
12420  Parameters:
12421  index - Identifier for the device instance
12422  Returns:
12423  - true - The CRCBitOrder feature is supported on the device
12424  - false - The CRCBitOrder feature is not supported on the device
12425  Remarks:
12426  None.
12427 */
12428 
12429 bool
12431  DMA_MODULE_ID index ) ;
12432 //******************************************************************************
12433 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12434  Summary:
12435  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12436  Description:
12437  This function identifies whether the CRCWriteByteOrder feature is available
12438  on the DMA module.
12439  When this function returns true, these functions are supported on the device:
12440  - PLIB_DMA_CRCWriteByteOrderAlter
12441  - PLIB_DMA_CRCWriteByteOrderMaintain
12442  Preconditions:
12443  None.
12444  Parameters:
12445  index - Identifier for the device instance
12446  Returns:
12447  - true - The CRCWriteByteOrder feature is supported on the device
12448  - false - The CRCWriteByteOrder feature is not supported on the device
12449  Remarks:
12450  None.
12451 */
12452 
12453 bool
12455  DMA_MODULE_ID index ) ;
12456 //******************************************************************************
12457 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12458  Summary:
12459  Identifies whether the CRCByteOrder feature exists on the DMA module.
12460  Description:
12461  This function identifies whether the CRCByteOrder feature is available on
12462  the DMA module.
12463  When this function returns true, these functions are supported on the device:
12464  - PLIB_DMA_CRCByteOrderSelect
12465  - PLIB_DMA_CRCByteOrderGet
12466  Preconditions:
12467  None.
12468  Parameters:
12469  index - Identifier for the device instance
12470  Returns:
12471  - true - The CRCByteOrder feature is supported on the device
12472  - false - The CRCByteOrder feature is not supported on the device
12473  Remarks:
12474  None.
12475 */
12476 
12477 bool
12479  DMA_MODULE_ID index ) ;
12480 //******************************************************************************
12481 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12482  Summary:
12483  Identifies whether the CRCData feature exists on the DMA module.
12484  Description:
12485  This function identifies whether the CRCData feature is available on the
12486  DMA module.
12487  When this function returns true, these functions are supported on the device:
12488  - PLIB_DMA_CRCDataRead
12489  - PLIB_DMA_CRCDataWrite
12490  Preconditions:
12491  None.
12492  Parameters:
12493  index - Identifier for the device instance
12494  Returns:
12495  - true - The CRCData feature is supported on the device
12496  - false - The CRCData feature is not supported on the device
12497  Remarks:
12498  None.
12499 */
12500 
12501 bool
12503  DMA_MODULE_ID index ) ;
12504 //******************************************************************************
12505 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12506  Summary:
12507  Identifies whether the CRCXOREnable feature exists on the DMA module.
12508  Description:
12509  This function identifies whether the CRCXOREnable feature is available on the
12510  DMA module.
12511  When this function returns true, these functions are supported on the device:
12512  - PLIB_DMA_CRCXOREnableSet
12513  - PLIB_DMA_CRCXOREnableGet
12514  Preconditions:
12515  None.
12516  Parameters:
12517  index - Identifier for the device instance
12518  Returns:
12519  - true - The CRCXOREnable feature is supported on the device
12520  - false - The CRCXOREnable feature is not supported on the device
12521  Remarks:
12522  None.
12523 */
12524 
12525 bool
12527  DMA_MODULE_ID index ) ;
12528 //******************************************************************************
12529 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12530  Summary:
12531  Identifies whether the ChannelXPriority feature exists on the DMA module.
12532  Description:
12533  This function identifies whether the ChannelXPriority feature is available on
12534  the DMA module.
12535  When this function returns true, these functions are supported on the device:
12536  - PLIB_DMA_ChannelXPrioritySelect
12537  - PLIB_DMA_ChannelXPriorityGet
12538  Preconditions:
12539  None.
12540  Parameters:
12541  index - Identifier for the device instance
12542  Returns:
12543  - true - The ChannelXPriority feature is supported on the device
12544  - false - The ChannelXPriority feature is not supported on the device
12545  Remarks:
12546  None.
12547 */
12548 
12549 bool
12551  DMA_MODULE_ID index ) ;
12552 //******************************************************************************
12553 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12554  Summary:
12555  Identifies whether the ChannelXEvent feature exists on the DMA module.
12556  Description:
12557  This function identifies whether the ChannelXEvent feature is available on
12558  the DMA module.
12559  When this function returns true, this function is supported on the device:
12560  - PLIB_DMA_ChannelXEventIsDetected
12561  Preconditions:
12562  None.
12563  Parameters:
12564  index - Identifier for the device instance
12565  Returns:
12566  - true - The ChannelXEvent feature is supported on the device
12567  - false - The ChannelXEvent feature is not supported on the device
12568  Remarks:
12569  None.
12570 */
12571 
12572 bool
12574  DMA_MODULE_ID index ) ;
12575 //******************************************************************************
12576 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12577  Summary:
12578  Identifies whether the ChannelXAuto feature exists on the DMA module.
12579  Description:
12580  This function identifies whether the ChannelXAuto feature is available on
12581  the DMA module.
12582  When this function returns true, these functions are supported on the device:
12583  - PLIB_DMA_ChannelXAutoEnable
12584  - PLIB_DMA_ChannelXAutoDisable
12585  - PLIB_DMA_ChannelXAutoIsEnabled
12586  Preconditions:
12587  None.
12588  Parameters:
12589  index - Identifier for the device instance
12590  Returns:
12591  - true - The ChannelXAuto feature is supported on the device
12592  - false - The ChannelXAuto feature is not supported on the device
12593  Remarks:
12594  None.
12595 */
12596 
12597 bool
12599  DMA_MODULE_ID index ) ;
12600 //******************************************************************************
12601 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12602  Summary:
12603  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12604  Description:
12605  This function identifies whether the ChannelXChainEnbl feature is available
12606  on the DMA module.
12607  When this function returns true, these functions are supported on the device:
12608  - PLIB_DMA_ChannelXChainEnable
12609  - PLIB_DMA_ChannelXChainDisable
12610  - PLIB_DMA_ChannelXChainIsEnabled
12611  Preconditions:
12612  None.
12613  Parameters:
12614  index - Identifier for the device instance
12615  Returns:
12616  - true - The ChannelXChainEnbl feature is supported on the device
12617  - false - The ChannelXChainEnbl feature is not supported on the device
12618  Remarks:
12619  None.
12620 */
12621 
12622 bool
12624  DMA_MODULE_ID index ) ;
12625 //******************************************************************************
12626 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12627  Summary:
12628  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12629  Description:
12630  This function identifies whether the ChannelXDisabled feature is available
12631  on the DMA module.
12632  When this function returns true, these functions are supported on the device:
12633  - PLIB_DMA_ChannelXDisabledEnablesEvents
12634  - PLIB_DMA_ChannelXDisabledDisablesEvents
12635  Preconditions:
12636  None.
12637  Parameters:
12638  index - Identifier for the device instance
12639  Returns:
12640  - true - The ChannelXDisabled feature is supported on the device
12641  - false - The ChannelXDisabled feature is not supported on the device
12642  Remarks:
12643  None.
12644 */
12645 
12646 bool
12648  DMA_MODULE_ID index ) ;
12649 //******************************************************************************
12650 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
12651  Summary:
12652  Identifies whether the ChannelX feature exists on the DMA module.
12653  Description:
12654  This function identifies whether the ChannelX feature is available on the
12655  DMA module.
12656  When this function returns true, these functions are supported on the device:
12657  - PLIB_DMA_ChannelXEnable
12658  - PLIB_DMA_ChannelXIsEnabled
12659  - PLIB_DMA_ChannelXDisable
12660  Preconditions:
12661  None.
12662  Parameters:
12663  index - Identifier for the device instance
12664  Returns:
12665  - true - The ChannelX feature is supported on the device
12666  - false - The ChannelX feature is not supported on the device
12667  Remarks:
12668  None.
12669 */
12670 
12671 bool
12673  DMA_MODULE_ID index ) ;
12674 //******************************************************************************
12675 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
12676  Summary:
12677  Identifies whether the ChannelXChain feature exists on the DMA module.
12678  Description:
12679  This function identifies whether the ChannelXChain feature is available on the
12680  DMA module.
12681  When this function returns true, these functions are supported on the device:
12682  - PLIB_DMA_ChannelXChainToLower
12683  - PLIB_DMA_ChannelXChainToHigher
12684  Preconditions:
12685  None.
12686  Parameters:
12687  index - Identifier for the device instance
12688  Returns:
12689  - true - The ChannelXChain feature is supported on the device
12690  - false - The ChannelXChain feature is not supported on the device
12691  Remarks:
12692  None.
12693 */
12694 
12695 bool
12697  DMA_MODULE_ID index ) ;
12698 //******************************************************************************
12699 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
12700  Summary:
12701  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
12702  Description:
12703  This function identifies whether the ChannelXPatternLength feature is available
12704  on the DMA module.
12705  When this function returns true, these functions are supported on the device:
12706  - PLIB_DMA_ChannelXPatternLengthSet
12707  - PLIB_DMA_ChannelXPatternLengthGet
12708  Preconditions:
12709  None.
12710  Parameters:
12711  index - Identifier for the device instance
12712  Returns:
12713  - true - The ChannelXPatternLength feature is supported on the device
12714  - false - The ChannelXPatternLength feature is not supported on the device
12715  Remarks:
12716  None.
12717 */
12718 
12719 bool
12721  DMA_MODULE_ID index ) ;
12722 //******************************************************************************
12723 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
12724  Summary:
12725  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
12726  module.
12727  Description:
12728  This function identifies whether the ChannelXPatternIgnoreByte feature is
12729  available on the DMA module.
12730  When this function returns true, these functions are supported on the device:
12731  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
12732  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
12733  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
12734  Preconditions:
12735  None.
12736  Parameters:
12737  index - Identifier for the device instance
12738  Returns:
12739  - true - The ChannelXPatternIgnoreByte feature is supported on the device
12740  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
12741  Remarks:
12742  None.
12743 */
12744 
12745 bool
12747  DMA_MODULE_ID index ) ;
12748 //******************************************************************************
12749 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
12750  Summary:
12751  Identifies whether the ChannelXBusy feature exists on the DMA module.
12752  Description:
12753  This function identifies whether the ChannelXBusy feature is available on the
12754  DMA module.
12755  When this function returns true, these functions are supported on the device:
12756  - PLIB_DMA_ChannelXBusyActiveSet
12757  - PLIB_DMA_ChannelXBusyInActiveSet
12758  - PLIB_DMA_ChannelXBusyIsBusy
12759  Preconditions:
12760  None.
12761  Parameters:
12762  index - Identifier for the device instance
12763  Returns:
12764  - true - The ChannelXBusy feature is supported on the device
12765  - false - The ChannelXBusy feature is not supported on the device
12766  Remarks:
12767  None.
12768 */
12769 
12770 bool
12772  DMA_MODULE_ID index ) ;
12773 //******************************************************************************
12774 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
12775  Summary:
12776  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
12777  Description:
12778  This function identifies whether the ChannelXPatternIgnore feature is available
12779  on the DMA module.
12780  When this function returns true, these functions are supported on the device:
12781  - PLIB_DMA_ChannelXPatternIgnoreSet
12782  - PLIB_DMA_ChannelXPatternIgnoreGet
12783  Preconditions:
12784  None.
12785  Parameters:
12786  index - Identifier for the device instance
12787  Returns:
12788  - true - The ChannelXPatternIgnore feature is supported on the device
12789  - false - The ChannelXPatternIgnore feature is not supported on the device
12790  Remarks:
12791  None.
12792 */
12793 
12794 bool
12796  DMA_MODULE_ID index ) ;
12797 //******************************************************************************
12798 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
12799  Summary:
12800  Identifies whether the ChannelXTrigger feature exists on the DMA module.
12801  Description:
12802  This function identifies whether the ChannelXTrigger feature is available on
12803  the DMA module.
12804  When this function returns true, these functions are supported on the device:
12805  - PLIB_DMA_ChannelXTriggerEnable
12806  - PLIB_DMA_ChannelXTriggerIsEnabled
12807  - PLIB_DMA_ChannelXTriggerDisable
12808  Preconditions:
12809  None.
12810  Parameters:
12811  index - Identifier for the device instance
12812  Returns:
12813  - true - The ChannelXTrigger feature is supported on the device
12814  - false - The ChannelXTrigger feature is not supported on the device
12815  Remarks:
12816  None.
12817 */
12818 
12819 bool
12821  DMA_MODULE_ID index ) ;
12822 //******************************************************************************
12823 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
12824  Summary:
12825  Identifies whether the AbortTransfer feature exists on the DMA module.
12826  Description:
12827  This function identifies whether the AbortTransfer feature is available on
12828  the DMA module.
12829  When this function returns true, this function is supported on the device:
12830  - PLIB_DMA_AbortTransferSet
12831  Preconditions:
12832  None.
12833  Parameters:
12834  index - Identifier for the device instance
12835  Returns:
12836  - true - The AbortTransfer feature is supported on the device
12837  - false - The AbortTransfer feature is not supported on the device
12838  Remarks:
12839  None.
12840 */
12841 
12842 bool
12844  DMA_MODULE_ID index ) ;
12845 //******************************************************************************
12846 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
12847  Summary:
12848  Identifies whether the StartTransfer feature exists on the DMA module.
12849  Description:
12850  This function identifies whether the StartTransfer feature is available on
12851  the DMA module.
12852  When this function returns true, this function is supported on the device:
12853  - PLIB_DMA_StartTransferSet
12854  Preconditions:
12855  None.
12856  Parameters:
12857  index - Identifier for the device instance
12858  Returns:
12859  - true - The StartTransfer feature is supported on the device
12860  - false - The StartTransfer feature is not supported on the device
12861  Remarks:
12862  None.
12863 */
12864 
12865 bool
12867  DMA_MODULE_ID index ) ;
12868 //******************************************************************************
12869 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
12870  Summary:
12871  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
12872  Description:
12873  This function identifies whether the ChannelXStartIRQ feature is available
12874  on the DMA module.
12875  When this function returns true, this function is supported on the device:
12876  - PLIB_DMA_ChannelXStartIRQSet
12877  Preconditions:
12878  None.
12879  Parameters:
12880  index - Identifier for the device instance
12881  Returns:
12882  - true - The ChannelXStartIRQ feature is supported on the device
12883  - false - The ChannelXStartIRQ feature is not supported on the device
12884  Remarks:
12885  None.
12886 */
12887 
12888 bool
12890  DMA_MODULE_ID index ) ;
12891 //******************************************************************************
12892 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
12893  Summary:
12894  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
12895  Description:
12896  This function identifies whether the ChannelXAbortIRQ feature is available
12897  on the DMA module.
12898  When this function returns true, this function is supported on the device:
12899  - PLIB_DMA_ChannelXAbortIRQSet
12900  Preconditions:
12901  None.
12902  Parameters:
12903  index - Identifier for the device instance
12904  Returns:
12905  - true - The ChannelXAbortIRQ feature is supported on the device
12906  - false - The ChannelXAbortIRQ feature is not supported on the device
12907  Remarks:
12908  None.
12909 */
12910 
12911 bool
12913  DMA_MODULE_ID index ) ;
12914 //******************************************************************************
12915 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
12916  Summary:
12917  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
12918  Description:
12919  This function identifies whether the ChannelXINTSourceFlag feature is available
12920  on the DMA module.
12921  When this function returns true, these functions are supported on the device:
12922  - PLIB_DMA_ChannelXINTSourceFlagGet
12923  - PLIB_DMA_ChannelXINTSourceFlagSet
12924  - PLIB_DMA_ChannelXINTSourceFlagClear
12925  Preconditions:
12926  None.
12927  Parameters:
12928  index - Identifier for the device instance
12929  Returns:
12930  - true - The ChannelXINTSourceFlag feature is supported on the device
12931  - false - The ChannelXINTSourceFlag feature is not supported on the device
12932  Remarks:
12933  None.
12934 */
12935 
12936 bool
12938  DMA_MODULE_ID index ) ;
12939 //******************************************************************************
12940 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
12941  Summary:
12942  Identifies whether the ChannelXINTSource feature exists on the DMA module.
12943  Description:
12944  This function identifies whether the ChannelXINTSource feature is available
12945  on the DMA module.
12946  When this function returns true, these functions are supported on the device:
12947  - PLIB_DMA_ChannelXINTSourceEnable
12948  - PLIB_DMA_ChannelXINTSourceDisable
12949  - PLIB_DMA_ChannelXINTSourceIsEnabled
12950  Preconditions:
12951  None.
12952  Parameters:
12953  index - Identifier for the device instance
12954  Returns:
12955  - true - The ChannelXINTSource feature is supported on the device
12956  - false - The ChannelXINTSource feature is not supported on the device
12957  Remarks:
12958  None.
12959 */
12960 
12961 bool
12963  DMA_MODULE_ID index ) ;
12964 //******************************************************************************
12965 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
12966  Summary:
12967  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
12968  Description:
12969  This function identifies whether the ChannelXSourceStartAddress feature is available
12970  on the DMA module.
12971  When this function returns true, these functions are supported on the device:
12972  - PLIB_DMA_ChannelXSourceStartAddressGet
12973  - PLIB_DMA_ChannelXSourceStartAddressSet
12974  Preconditions:
12975  None.
12976  Parameters:
12977  index - Identifier for the device instance
12978  Returns:
12979  - true - The ChannelXSourceStartAddress feature is supported on the device
12980  - false - The ChannelXSourceStartAddress feature is not supported on the device
12981  Remarks:
12982  None.
12983 */
12984 
12985 bool
12987  DMA_MODULE_ID index ) ;
12988 //******************************************************************************
12989 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
12990  Summary:
12991  Identifies whether the ChannelXDestinationStartAddress feature exists on
12992  the DMA module.
12993  Description:
12994  This function identifies whether the ChannelXDestinationStartAddress feature
12995  is available on the DMA module.
12996  When this function returns true, these functions are supported on the device:
12997  - PLIB_DMA_ChannelXDestinationStartAddressGet
12998  - PLIB_DMA_ChannelXDestinationStartAddressSet
12999  Preconditions:
13000  None.
13001  Parameters:
13002  index - Identifier for the device instance
13003  Returns:
13004  - true - The ChannelXDestinationStartAddress feature is supported on the device
13005  - false - The ChannelXDestinationStartAddress feature is not supported on the device
13006  Remarks:
13007  None.
13008 */
13009 
13010 bool
13012  DMA_MODULE_ID index ) ;
13013 //******************************************************************************
13014 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
13015  Summary:
13016  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
13017  Description:
13018  This function identifies whether the ChannelXSourceSize feature is available
13019  on the DMA module.
13020  When this function returns true, these functions are supported on the device:
13021  - PLIB_DMA_ChannelXSourceSizeGet
13022  - PLIB_DMA_ChannelXSourceSizeSet
13023  Preconditions:
13024  None.
13025  Parameters:
13026  index - Identifier for the device instance
13027  Returns:
13028  - true - The ChannelXSourceSize feature is supported on the device
13029  - false - The ChannelXSourceSize feature is not supported on the device
13030  Remarks:
13031  None.
13032 */
13033 
13034 bool
13036  DMA_MODULE_ID index ) ;
13037 //******************************************************************************
13038 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
13039  Summary:
13040  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
13041  Description:
13042  This function identifies whether the ChannelXDestinationSize feature is available
13043  on the DMA module.
13044  When this function returns true, these functions are supported on the device:
13045  - PLIB_DMA_ChannelXDestinationSizeGet
13046  - PLIB_DMA_ChannelXDestinationSizeSet
13047  Preconditions:
13048  None.
13049  Parameters:
13050  index - Identifier for the device instance
13051  Returns:
13052  - true - The ChannelXDestinationSize feature is supported on the device
13053  - false - The ChannelXDestinationSize feature is not supported on the device
13054  Remarks:
13055  None.
13056 */
13057 
13058 bool
13060  DMA_MODULE_ID index ) ;
13061 //******************************************************************************
13062 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
13063  Summary:
13064  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
13065  Description:
13066  This function identifies whether the ChannelXSourcePointer feature is available
13067  on the DMA module.
13068  When this function returns true, this function is supported on the device:
13069  - PLIB_DMA_ChannelXSourcePointerGet
13070  Preconditions:
13071  None.
13072  Parameters:
13073  index - Identifier for the device instance
13074  Returns:
13075  - true - The ChannelXSourcePointer feature is supported on the device
13076  - false - The ChannelXSourcePointer feature is not supported on the device
13077  Remarks:
13078  None.
13079 */
13080 
13081 bool
13083  DMA_MODULE_ID index ) ;
13084 //******************************************************************************
13085 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
13086  Summary:
13087  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
13088  Description:
13089  This function identifies whether the ChannelXDestinationPointer feature is available
13090  on the DMA module.
13091  When this function returns true, this function is supported on the device:
13092  - PLIB_DMA_ChannelXDestinationPointerGet
13093  Preconditions:
13094  None.
13095  Parameters:
13096  index - Identifier for the device instance
13097  Returns:
13098  - true - The ChannelXDestinationPointer feature is supported on the device
13099  - false - The ChannelXDestinationPointer feature is not supported on the device
13100  Remarks:
13101  None.
13102 */
13103 
13104 bool
13106  DMA_MODULE_ID index ) ;
13107 //******************************************************************************
13108 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13109  Summary:
13110  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13111  Description:
13112  This function identifies whether the ChannelXCellSize feature is available on
13113  the DMA module.
13114  When this function returns true, these functions are supported on the device:
13115  - PLIB_DMA_ChannelXCellSizeGet
13116  - PLIB_DMA_ChannelXCellSizeSet
13117  Preconditions:
13118  None.
13119  Parameters:
13120  index - Identifier for the device instance
13121  Returns:
13122  - true - The ChannelXCellSize feature is supported on the device
13123  - false - The ChannelXCellSize feature is not supported on the device
13124  Remarks:
13125  None.
13126 */
13127 
13128 bool
13130  DMA_MODULE_ID index ) ;
13131 //******************************************************************************
13132 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13133  Summary:
13134  Identifies whether the ChannelXCellProgressPointer feature exists on the
13135  DMA module.
13136  Description:
13137  This function identifies whether the ChannelXCellProgressPointer feature is
13138  available on the DMA module.
13139  When this function returns true, this function is supported on the device:
13140  - PLIB_DMA_ChannelXCellProgressPointerGet
13141  Preconditions:
13142  None.
13143  Parameters:
13144  index - Identifier for the device instance
13145  Returns:
13146  - true - The ChannelXCellProgressPointer feature is supported on the device
13147  - false - The ChannelXCellProgressPointer feature is not supported on the device
13148  Remarks:
13149  None.
13150 */
13151 
13152 bool
13154  DMA_MODULE_ID index ) ;
13155 //******************************************************************************
13156 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13157  Summary:
13158  Identifies whether the ChannelXPatternData feature exists on the DMA module
13159  Description:
13160  This function identifies whether the ChannelXPatternData feature is available
13161  on the DMA module.
13162  When this function returns true, these functions are supported on the device:
13163  - PLIB_DMA_ChannelXPatternDataGet
13164  - PLIB_DMA_ChannelXPatternDataSet
13165  Preconditions:
13166  None.
13167  Parameters:
13168  index - Identifier for the device instance
13169  Returns:
13170  - true - The ChannelXPatternData feature is supported on the device
13171  - false - The ChannelXPatternData feature is not supported on the device
13172  Remarks:
13173  None.
13174 */
13175 
13176 bool
13178  DMA_MODULE_ID index ) ;
13179 //DOM-IGNORE-BEGIN
13180 //DOM-IGNORE-END
13181  // #ifndef _PLIB_DMA_H
13182 /*******************************************************************************
13183  End of File
13184 */
13185 
13186 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13187 /* CLOSE_FILE Include File */
13188 
13189 // *****************************************************************************
13190 // *****************************************************************************
13191 // Section: Data Types
13192 // *****************************************************************************
13193 // *****************************************************************************
13194 // *****************************************************************************
13195 /* DMA System Service Channel None
13196  Summary:
13197  DMA channel none
13198  Description:
13199  This constant identifies the specification of no choice from client
13200  for allocating a particular DMA channel.
13201  Remarks:
13202  This constant should be used in place of hard-coded numeric literals.
13203 */
13204 //DOM-IGNORE-BEGIN
13205 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13206 //DOM-IGNORE-END
13207 // *****************************************************************************
13208 /* DMA System Service Channel Any
13209  Summary:
13210  Identifies the client specification to allocate any available DMA channel.
13211  Description:
13212  This constant identifies the specification by the client
13213  to allocate any available DMA channel.
13214  Remarks:
13215  This constant should be used in place of hard-coded numeric literals.
13216 */
13217 //DOM-IGNORE-BEGIN
13218 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13219 //DOM-IGNORE-END
13220 // *****************************************************************************
13221 /* DMA System Service Channel Count
13222  Summary:
13223  Identifies the maximum number of DMA channel handles to be defined.
13224  Description:
13225  This constant identifies the maximum number of DMA channel handles
13226  that should be defined.
13227  Remarks:
13228  This value is derived from device-specific header files defined as
13229  part of the peripheral libraries.
13230 */
13231 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13232 // *****************************************************************************
13233 /* DMA System Service Channel Handle
13234  Summary:
13235  Assigns the handle for requested channel.
13236  Description:
13237  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13238  function. This handle is associated with the channel number that is used for
13239  data transfer and it allows the application to track the data transfer.
13240  The channel handle once assigned to a client expires when the
13241  client calls SYS_DMA_ChannelRelease.
13242  exits.
13243  Remarks:
13244  None.
13245 */
13246 
13247 typedef
13248 uintptr_t
13250 // *****************************************************************************
13251 /* DMA System Service Invalid Channel Handle
13252  Summary:
13253  Defines an invalid channel handle.
13254  Description:
13255  This is the definition of an invalid channel handle. An invalid buffer handle
13256  is returned by SYS_DMA_ChannelAllocate function if the channel number
13257  request was not successful.
13258  Remarks:
13259  None.
13260 */
13261 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13262 // *****************************************************************************
13263 /* DMA stop in idle mode
13264  Summary:
13265  Enable/Disable DMA operations in Idle mode.
13266  Description:
13267  This data type allows enabling/disabling of DMA operations in idle mode.
13268  Remarks:
13269  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13270  while initializing the DMA module by calling SYS_DMA_Initialize.
13271  This feature may not be available on all devices. Refer to the specific device
13272  data sheet to determine availability.
13273 */
13274 
13275 typedef
13276  enum
13277  {
13278  /* When the CPU enters idle mode, the DMA module continue operations */
13280  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13282  } SYS_DMA_SIDL ;
13283 // *****************************************************************************
13284 /* DMA Channel chaining priority
13285  Summary:
13286  Identifies the priority of chaining channel.
13287  Description:
13288  This data type identifies the priority of chaining channel.
13289  Channel chaining priority identifies the channel that will be enabled
13290  on completion of block data transfer on the master channel.
13291  Remarks:
13292  None.
13293 */
13294 
13295 typedef
13296  enum
13297  {
13298  /* Chain to channel higher in natural priority */
13300  /* Chain to channel lower in natural priority */
13303 // *****************************************************************************
13304 /* DMA Channel ignore pattern match
13305  Summary:
13306  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13307  pattern.
13308  Description:
13309  This data type allows enabling/disabling the feature to ignore a byte
13310  between a 2-byte match abort pattern.
13311  Remarks:
13312  This feature may not be available on all devices. Refer to the specific device
13313  data sheet to determine availability.
13314 */
13315 
13316 typedef
13317  enum
13318  {
13319  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13321  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13324 // *****************************************************************************
13325 /* DMA channel CRC mode
13326  Summary:
13327  Identifies the operation mode of the CRC module.
13328  Description:
13329  This data type identifies CRC operating mode. The CRC computation can be
13330  in background mode or append mode.
13331  Remarks:
13332  None.
13333 */
13334 
13335 typedef
13336  enum
13337  {
13338  /* DMA reads the data from the source, passes it through the CRC module and
13339  writes it to the destination. the calculated CRC is left in the DCRCDATA
13340  register at the end of the block transfer. */
13342  /* DMA only feeds source data to the CRC module. it does not write source data
13343  to the destination address. When a block transfer complete or pattern abort
13344  event occur, The DMA writes the CRC value to the destination address */
13347 // *****************************************************************************
13348 /* DMA channel CRC write order
13349  Summary:
13350  Identifies altering/maintaining write order post CRC computation.
13351  Description:
13352  This data type identifies write byte order selection post CRC
13353  computation.
13354  Remarks:
13355  None.
13356 */
13357 
13358 typedef
13359  enum
13360  {
13361  /* Source data is written to the destination unchanged regardless
13362  of the selected pre-CRC byte order. */
13364  /* Source data is written to the destination reordered according
13365  to the selected pre-CRC byte order. */
13368 // *****************************************************************************
13369 /* DMA channel operation modes
13370  Summary:
13371  Identifies the available DMA operating modes.
13372  Description:
13373  This data type Identifies the available DMA operating modes.
13374  The supported DMA modes are not mutually exclusive, but can be simultaneously
13375  operational.
13376  Remarks:
13377  These supported DMA modes can be logically OR'd together. They are passed
13378  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13379 */
13380 
13381 typedef
13382  enum
13383  {
13384  /* The normal DMA operation mode. The DMA channel will transfer data from
13385  a source to a destination without CPU intervention */
13386  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13387  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13388  ,
13389  /* Pattern Match abort mode allows the user to end a transfer if data
13390  written during a transaction matches a specific pattern, as defined by
13391  the DCHxDAT register */
13393  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13394  ,
13395  /* Channel chaining operating mode enhances the normal DMA channel
13396  operations. A channel(slave) can be chained to an adjacent channel(master).
13397  The slave channel will be enabled when a block transfer of the master
13398  channel completes. */
13399  /* only one of the below two chaining priorities must be provided.
13400  Chaining priority High. */
13402  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13403  ,
13404  /* Chaining priority Low */
13406  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13407  ,
13408  /* Auto enable operating mode allows a channel to be kept active, even if a
13409  block transfer completes or pattern match occurs. This prevents the user
13410  from having to re-enable the channel each time a block transfer completes. */
13411  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13412  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13413  ,
13414  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13415  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13416  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13418 // *****************************************************************************
13419 /* DMA channel CRC mode
13420  Summary:
13421  Defines the attributes for CRC operation mode.
13422  Description:
13423  This data type defines the attributes for CRC operation mode.
13424  Remarks:
13425  This feature may not be available on all devices. Refer to the specific device
13426  data sheet to determine availability.
13427 */
13428 
13429 typedef
13430  struct
13431  {
13432  /* CRC type (PLIB-level).
13433  Type Selection identifies whether the CRC module will calculate an IP
13434  header checksum or an LFSR CRC */
13435  DMA_CRC_TYPE type ;
13436  /* CRC mode, Background or Append */
13438  /* Polynomial length, This value is redundant when the selected CRC type is
13439  IP header checksum. When the CRC type is LFSR, Identifies the length of
13440  the polynomial. */
13441  uint8_t polyLength ;
13442  /* Bit order (PLIB-level).
13443  Identifies whether the CRC is computed LSb or MSb first */
13444  DMA_CRC_BIT_ORDER bitOrder ;
13445  /* Byte order (PLIB-level).
13446  Identifies the byte selection order input pre-CRC Generator. */
13447  DMA_CRC_BYTE_ORDER byteOrder ;
13448  /* Post CRC Write order */
13450  /* CRC data feed: While enabling the CRC mode, this field gives
13451  the seed for the CRC computation. On block transfer complete or
13452  pattern match abort the field have the computed CRC. */
13453  uint32_t data ;
13454  /* XOR bit mask, This value is redundant when the selected CRC type is
13455  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13456  bit mask input to the shift register during CRC computation. */
13457  uint32_t xorBitMask ;
13459 // *****************************************************************************
13460 /* DMA System service Events
13461  Summary:
13462  Enumeration of possible DMA System service events.
13463  Description:
13464  This data type provides an enumeration of all possible DMA System service events.
13465  Remarks:
13466  None.
13467 */
13468 
13469 typedef
13470  enum
13471  {
13472  /* Data was transferred successfully. */
13474  /* Error while processing the request */
13476  /* Data transfer was aborted. */
13478  /* No events yet. */
13481 // *****************************************************************************
13482 /* DMA System service Error
13483  Summary:
13484  Indicates the error information for the DMA System service.
13485  Description:
13486  This enumeration indicates the error information for the DMA System service.
13487  Remarks:
13488  None.
13489 */
13490 
13491 typedef
13492  enum
13493  {
13494  /* Data was transferred successfully. */
13495  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13496  = 1 << 0 ,
13497  /* DOM-IGNORE-END*/
13498  /* DMA address error. */
13499  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13500  = 1 << 1 /* DOM-IGNORE-END*/
13501  } SYS_DMA_ERROR ;
13502 // *****************************************************************************
13503 /* DMA Initialization data
13504  Summary:
13505  Defines the data required to initialize the DMA subsystem.
13506  Description:
13507  This data type defines the data required to initialize the DMA subsystem.
13508  Remarks:
13509  This feature may not be available on all devices. Refer to the specific device
13510  data sheet to determine availability.
13511 */
13512 
13513 typedef
13514  struct
13515  {
13516  /* Enable/Disable stop in idle mode feature */
13518  } SYS_DMA_INIT ;
13519 // *****************************************************************************
13520 /* Data width options */
13521 
13522 typedef
13523  enum
13524  {
13525  /* Data width configuration feature is not available */
13527  } SYS_DMA_DATA_WIDTH ;
13528 // *****************************************************************************
13529 /* DMA descriptor control
13530  Summary:
13531  Defines the descriptor control for linked list operation.
13532  Description:
13533  This data type defines the descriptor control for linked list operation.
13534  Remarks:
13535  This feature may not be available on all devices. Refer to the specific device
13536  data sheet to determine availability.
13537 */
13538 
13539 typedef
13540  union
13541  {
13542  /* Feature is not supported */
13543  ;
13545 // *****************************************************************************
13546 // *****************************************************************************
13547 // Section: Initialization and Task Functions
13548 // *****************************************************************************
13549 // *****************************************************************************
13550 //******************************************************************************
13551 /* Function:
13552  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13553  Summary:
13554  Maintains the system service's state machine.
13555 
13556  Description:
13557  This function is used to maintain the DMA system service's internal state
13558  machine. This function services events on a specific DMA channel.
13559  Precondition:
13560  DMA should have been initialized by calling SYS_DMA_Initialize.
13561  Parameters:
13562  object - Object handle for the DMA module (returned from
13563  SYS_DMA_Initialize)
13564  activeChannel - DMA channel number to be serviced.
13565  Returns:
13566  None.
13567  Example:
13568  <code>
13569  // 'object' Returned from SYS_DMA_Initialize
13570  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13571  {
13572  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13573  }
13574  </code>
13575  Remarks:
13576  This function is normally not called directly by an application. It is
13577  called by the system's task/interrupt routines.
13578  */
13579 
13580 void
13581  SYS_DMA_Tasks (
13582  SYS_MODULE_OBJ object ,
13583  DMA_CHANNEL activeChannel ) ;
13584 //******************************************************************************
13585 /* For backward compatibility */
13586 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13587  // #ifndef _SYS_DMA_DEFINITIONS_H
13588 /*******************************************************************************
13589  End of File
13590 */
13591 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13592 /* CLOSE_FILE Include File */
13593 
13594 // DOM-IGNORE-BEGIN
13595 // DOM-IGNORE-END
13596 // *****************************************************************************
13597 // *****************************************************************************
13598 // Section: DMA System Service Interface Routines
13599 // *****************************************************************************
13600 // *****************************************************************************
13601 // *****************************************************************************
13602 /* DMA System service Transfer Event Handler Function
13603  Summary:
13604  Pointer to a DMA System service Transfer Event handler function.
13605  Description:
13606  This data type defines a DMA System service Transfer Event Handler Function.
13607  A DMA system service client must register an transfer event handler function of
13608  this type to receive transfer related events from the system service.
13609  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13610  was transferred successfully. The channelHandle parameter contains the channel
13611  handle of the channel on which the transfer was processed.
13612  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13613  not transferred successfully. TThe channelHandle parameter contains the channel
13614  handle of the channel on which the transfer had failed.
13615  The contextHandle parameter contains the context handle that was provided by
13616  the client at the time of registering the event handler. This context handle
13617  can be anything that the client consider helpful or necessary to identify
13618  the client context object associated with the channel of the system
13619  service that generated the event.
13620  The event handler function executes in an interrupt context when DMA is setup
13621  to start operation by an interrupt trigger source. It is recommended of the
13622  application to not perform process intensive operations with in this
13623  function.
13624  Remarks:
13625  None.
13626 */
13627 
13628 typedef
13630 SYS_DMA_CHANNEL_HANDLE handle ,
13631 uintptr_t contextHandle ) ;
13632 // *****************************************************************************
13633 // *****************************************************************************
13634 // Section: Initialization and Task Functions
13635 // *****************************************************************************
13636 // *****************************************************************************
13637 //******************************************************************************
13638 /* Function:
13639  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
13640  Summary:
13641  Initializes and Enables the DMA Controller.
13642  Description:
13643  This function Enables the DMA module. Enable/Disable stop in idle mode
13644  feature based on the passed parameter value.
13645  This function initializes the DMA module making it ready for clients to
13646  open and use it. The initialization data is specified by the init parameter.
13647  Precondition:
13648  None.
13649  Parameters:
13650  init - Pointer to the data structure containing any data
13651  necessary to initialize the hardware. This pointer may
13652  be null if no data is required and default
13653  initialization is to be used.
13654  Returns:
13655  If successful, returns a valid handle to the DMA module object.
13656  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
13657  Example:
13658  <code>
13659  SYS_MODULE_OBJ objectHandle;
13660  SYS_DMA_INIT initParam;
13661  initParam.sidl = SYS_DMA_SIDL_ENABLE;
13662  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
13663  (SYS_MODULE_INIT*)initParam);
13664  if (SYS_MODULE_OBJ_INVALID == objectHandle)
13665  {
13666  // Handle error
13667  }
13668  </code>
13669  Remarks:
13670  This function must be called before any other DMA systems service routines
13671  are called.
13672  Not all features are available on all micro-controllers.
13673 */
13674 
13675 SYS_MODULE_OBJ
13677  const SYS_MODULE_INIT * const init ) ;
13678 // *****************************************************************************
13679 // *****************************************************************************
13680 // Section: Channel Setup and management functions
13681 // *****************************************************************************
13682 // *****************************************************************************
13683 //******************************************************************************
13684 /* Function:
13685  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
13686  Summary:
13687  Allocates the specified DMA channel and returns a handle to it.
13688  Description:
13689  This function opens the specified DMA channel and provides a
13690  handle that must be provided to all other client-level operations to
13691  identify the caller and the DMA channel.
13692  Precondition:
13693  Function SYS_DMA_Initialize must have been called before calling this
13694  function.
13695  Parameters:
13696  channel - Channel number requested for allocation.
13697  When channel number specified is DMA_CHANNEL_ANY
13698  a random channel is allocated for DMA transfers.
13699  Returns:
13700  The channel handle for the requested channel number.
13701  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
13702  Error can occur.
13703  - if the requested channel number is invalid.
13704  - if the requested channel number is not free.
13705  Example:
13706  <code>
13707  DMA_CHANNEL channel;
13708  SYS_DMA_CHANNEL_HANDLE handle
13709  channel = DMA_CHANNEL_2;
13710  handle = SYS_DMA_ChannelAllocate(channel);
13711  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
13712  {
13713  // Failed to allocate the channel
13714  }
13715  else
13716  {
13717  // Proceed with setting up the channel and adding the transfer
13718  }
13719  </code>
13720  Remarks:
13721  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
13722  This function must be called before any other DMA channel Setup and management
13723  routines are called
13724 */
13725 
13728  DMA_CHANNEL channel ) ;
13729 //******************************************************************************
13730 /* Function:
13731  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
13732  Summary:
13733  Deallocates and frees the channel specified by the handle.
13734  Description:
13735  This function deallocates an allocated-channel of the DMA module,
13736  invalidating the handle.
13737  Precondition:
13738  DMA should have been initialized by calling SYS_DMA_Initialize.
13739  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
13740  Parameters:
13741  handle - A valid allocated-channel handle, returned from the service's
13742  Allocate routine
13743  Returns:
13744  None.
13745  Example:
13746  <code>
13747  DMA_CHANNEL channel;
13748  SYS_DMA_CHANNEL_HANDLE handle;
13749  channel = DMA_CHANNEL_2;
13750  handle = SYS_DMA_ChannelAllocate(channel);
13751  SYS_DMA_ChannelRelease(handle);
13752  </code>
13753  Remarks:
13754  After calling this routine, the handle passed in "handle" must not be used
13755  with any of the remaining service's routines. A new handle must be obtained by
13756  calling SYS_DMA_ChannelAllocate before the caller may use the service again
13757 */
13758 
13759 void
13761  SYS_DMA_CHANNEL_HANDLE handle ) ;
13762 //******************************************************************************
13763 /* Function:
13764  void SYS_DMA_ChannelSetup
13765  (
13766  SYS_DMA_CHANNEL_HANDLE handle,
13767  SYS_DMA_CHANNEL_OP_MODE modeEnable
13768  DMA_TRIGGER_SOURCE eventSrc
13769  )
13770  Summary:
13771  Setup the DMA channel parameters.
13772  Description:
13773  This function sets up the DMA channel parameters.
13774  It sets the channel priority and enables the mode of operations for the
13775  current system design.
13776  Precondition:
13777  DMA should have been initialized by calling SYS_DMA_Initialize.
13778  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13779  Parameters:
13780  handle - Handle of the DMA channel as returned by the
13781  SYS_DMA_ChannelAllocate function.
13782  priority - The priority to be associated to the channel.
13783  modeEnable - The supported operating modes to be enabled.
13784  This parameter can be logically ORed to specify
13785  multiple options.
13786  eventSrc - The event causing the cell transfer start.
13787  Returns:
13788  None.
13789  Example:
13790  <code>
13791  // 'handle' is a valid handle returned
13792  // by the SYS_DMA_ChannelAllocate function.
13793  SYS_DMA_CHANNEL_OP_MODE modeEnable;
13794  DMA_TRIGGER_SOURCE eventSrc;
13795  channel = DMA_CHANNEL_2;
13796  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
13797  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
13798  // Setup channel number, and enables basic and CRC mode
13799  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
13800  </code>
13801  Remarks:
13802  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
13803  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
13804  mode setup API's needs to be called to set the related parameters.
13805  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
13806  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
13807  Not all features are available on all microcontrollers.
13808  */
13809 
13810 void
13812  SYS_DMA_CHANNEL_HANDLE handle ,
13813  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
13814  DMA_TRIGGER_SOURCE eventSrc ) ;
13815 //******************************************************************************
13816 /* Function:
13817  void SYS_DMA_ChannelSetupMatchAbortMode
13818  (
13819  SYS_DMA_CHANNEL_HANDLE handle,
13820  uint16_t pattern,
13821  DMA_PATTERN_LENGTH length,
13822  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
13823  uint8_t ignorePattern
13824  )
13825  Summary:
13826  Setup the pattern match abort mode.
13827  Description:
13828  This function sets up the termination of DMA operation when the specified
13829  pattern is matched. Additionally on supported parts the function also
13830  sets up the ignoring of part of a pattern(8-bit) from match abort
13831  pattern(16-bit).
13832  Precondition:
13833  DMA should have been initialized by calling SYS_DMA_Initialize.
13834  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13835  The function SYS_DMA_ChannelSetup must be called to enable
13836  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
13837  match mode features.
13838  Parameters:
13839  handle - Handle of the DMA channel as returned by the
13840  SYS_DMA_ChannelAllocate function.
13841  pattern - The pattern that needs to be matched to abort a DMA transfer.
13842  length - Match pattern length can be 1-byte or 2-byte.
13843  ignore - Enable/Disable a byte between a 2-byte pattern match.
13844  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
13845  from the match abort pattern(16-bit)
13846  Returns:
13847  None.
13848  Example:
13849  <code>
13850  // Example 1
13851  // The following code is for a device with an 8-bit pattern value and no
13852  // support for pattern match ignore feature
13853  // 'handle' is a valid handle returned
13854  // by the SYS_DMA_ChannelAllocate function.
13855  uint16_t pattern;
13856  DMA_PATTERN_LENGTH length;
13857  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13858  uint8_t ignorePattern;
13859  pattern = 0x00; //Stop transfer on detection of a NULL character
13860  length = DMA_PATTERN_LENGTH_NONE;
13861  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
13862  ignorePattern = 0;
13863  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13864  ignoreEnable, ignorePattern);
13865  // Example 2
13866  // The following code is for a device with a 16-bit pattern value and
13867  // support for pattern match ignore feature
13868  // 'handle' is a valid handle returned
13869  // by the SYS_DMA_ChannelAllocate function.
13870  uint16_t pattern;
13871  DMA_PATTERN_LENGTH length;
13872  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13873  uint8_t ignorePattern;
13874  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
13875  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
13876  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
13877  ignorePattern = 0x00; \\ Any null character between the termination pattern
13878  \\ '\r' and '\n' is ignored.
13879  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13880  ignore, ignorePattern);
13881  </code>
13882  Remarks:
13883  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
13884  Not all features are available on all devices.
13885  Refer to the specific device data sheet for details.
13886 */
13887 
13888 void
13890  SYS_DMA_CHANNEL_HANDLE handle ,
13891  uint16_t pattern ,
13892  DMA_PATTERN_LENGTH length ,
13894  uint8_t ignorePattern ) ;
13895 //******************************************************************************
13896 /* Function:
13897  void SYS_DMA_ChannelCRCSet
13898  (
13899  SYS_DMA_CHANNEL_HANDLE handle,
13900  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
13901  )
13902  Summary:
13903  Sets up the CRC operation mode.
13904  Description:
13905  This function sets up the CRC computation features.
13906  Precondition:
13907  DMA should have been initialized by calling SYS_DMA_Initialize.
13908  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13909  The function SYS_DMA_ChannelSetup must be called to enable
13910  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13911  Parameters:
13912  handle - Handle of the DMA channel as returned by the
13913  SYS_DMA_ChannelAllocate function.
13914  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
13915  crc.mode - Compute the CRC in Background/Append mode.
13916  crc.polyLength - Denotes the length of the polynomial.
13917  crc.bitOrder - CRC is calculated LSb/MSb first.
13918  crc.byteOrder - Byte selection order input pre-CRC Generator
13919  crc.writeOrder - Write byte order selection post-CRC computation
13920  crc.data - Computed/Seed CRC
13921  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
13922  when mode is LFSR
13923  Returns:
13924  None.
13925  Example:
13926  <code>
13927  //Example 1
13928  // DMA calculation using the CRC background mode
13929  // 'handle' is a valid handle returned
13930  // by the SYS_DMA_ChannelAllocate function.
13931  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
13932  crc.type = DMA_CRC_LFSR;
13933  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
13934  crc.polyLength = 16;
13935  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
13936  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
13937  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
13938  crc.data = 0xFFFF;
13939  crc.xorBitMask = 0x1021;
13940  SYS_DMA_ChannelCRCSet(handle, crc);
13941  </code>
13942  Remarks:
13943  This feature may not be available on all devices. Refer to the specific device
13944  data sheet to determine availability.
13945 */
13946 
13947 void
13949  SYS_DMA_CHANNEL_HANDLE handle ,
13951 //******************************************************************************
13952 /* Function:
13953  uint32_t SYS_DMA_ChannelCRCGet(void)
13954  Summary:
13955  Returns the computed CRC.
13956  Description:
13957  This function returns the computed CRC
13958  Precondition:
13959  DMA should have been initialized by calling SYS_DMA_Initialize.
13960  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13961  The function SYS_DMA_ChannelSetup must be called to enable
13962  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13963  The CRC generator must have been previously setup using
13964  SYS_DMA_ChannelCRCSet.
13965  Parameters:
13966  None
13967  Returns:
13968  uint32_t - The Computed CRC.
13969  Example:
13970  <code>
13971  uint32_t computedCRC;
13972  computedCRC = SYS_DMA_ChannelCRCGet();
13973  </code>
13974  Remarks:
13975  To get the computed CRC value this function must be called after the block
13976  transfer completion event (i.e., after getting and processing the callback
13977  registered with SYS_DMA_ChannelTransferEventHandlerSet).
13978  This feature may not be available on all devices. Refer to the specific device
13979  data sheet to determine availability.
13980 */
13981 
13982 uint32_t
13983  SYS_DMA_ChannelCRCGet ( void ) ;
13984 //******************************************************************************
13985 /* Function:
13986  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
13987  Summary:
13988  Enables a channel.
13989  Description:
13990  This function enables a channel.
13991  Precondition:
13992  DMA should have been initialized by calling SYS_DMA_Initialize.
13993  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13994  The function SYS_DMA_ChannelSetup must have been called to setup and
13995  enable the required features.
13996  Parameters:
13997  handle - Handle of the DMA channel as returned by the
13998  SYS_DMA_ChannelAllocate function.
13999  Returns:
14000  None.
14001  Example:
14002  <code>
14003  // 'handle' is a valid handle returned
14004  // by the SYS_DMA_ChannelAllocate function.
14005  SYS_DMA_ChannelEnable(handle);
14006  </code>
14007  Remarks:
14008  This function may not required to be called when starting DMA setup
14009  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
14010  But may be needed to be called in the registered callback to enable the
14011  channel and continue the data transfer with the existing transfer parameters
14012  previously set with 'SYS_DMA_ChannelTransferAdd'.
14013  The DMA channel is by default disabled on the completion of block
14014  transfer(callback generated)
14015 */
14016 
14017 void
14019  SYS_DMA_CHANNEL_HANDLE handle ) ;
14020 //******************************************************************************
14021 /* Function:
14022  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
14023  Summary:
14024  Disables a channel.
14025  Description:
14026  This function disables a channel.
14027  Precondition:
14028  DMA should have been initialized by calling SYS_DMA_Initialize.
14029  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14030  The function SYS_DMA_ChannelSetup must have been called to setup and
14031  enable the required features.
14032  A DMA channel should have been enabled either by calling
14033  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
14034  Parameters:
14035  handle - Handle of the DMA channel as returned by the
14036  SYS_DMA_ChannelAllocate function.
14037  Returns:
14038  None.
14039  Example:
14040  <code>
14041  // 'handle' is a valid handle returned
14042  // by the SYS_DMA_ChannelAllocate function.
14043  SYS_DMA_ChannelDisable(handle);
14044  </code>
14045  Remarks:
14046  None.
14047 */
14048 
14049 void
14051  SYS_DMA_CHANNEL_HANDLE handle ) ;
14052 //******************************************************************************
14053 /* Function:
14054  void SYS_DMA_ChannelTransferAdd
14055  (
14056  SYS_DMA_CHANNEL_HANDLE handle,
14057  const void *srcAddr, size_t srcSize
14058  const void *destAddr, size_t destSize,
14059  size_t cellSize
14060  )
14061  Summary:
14062  Adds a data transfer to a DMA channel and Enables the channel to start
14063  data transfer.
14064  Description:
14065  This function adds a data transfer characteristics for a DMA channel. The
14066  The source and the destination addresses, source and destination lengths,
14067  The number of bytes transferred per cell event are set. It also enables
14068  the channel to start data transfer.
14069  If the requesting client registered an event callback with the service,
14070  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
14071  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
14072  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
14073  processed successfully.
14074  Precondition:
14075  DMA should have been initialized by calling SYS_DMA_Initialize.
14076  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14077  The function SYS_DMA_ChannelSetup must have been called to setup and
14078  enable the required features.
14079  Parameters:
14080  handle - Handle of the DMA channel as returned by the
14081  SYS_DMA_ChannelAllocate function.
14082  srcAddr - Source of the DMA transfer
14083  srcSize - Size of the source
14084  destAddr - Destination of the DMA transfer
14085  destSize - Size of the destination
14086  cellSize - Size of the cell
14087  Returns:
14088  None.
14089  Example:
14090  <code>
14091  // Add 10 bytes of data transfer to UART TX
14092  // 'handle' is a valid handle returned
14093  // by the SYS_DMA_ChannelAllocate function.
14094  MY_APP_OBJ myAppObj;
14095  uint8_t buf[10];
14096  void *srcAddr;
14097  void *destAddr;
14098  size_t srcSize;
14099  size_t destSize;
14100  size_t cellSize;
14101  srcAddr = (uint8_t *) buf;
14102  srcSize = 10;
14103  destAddr = (uin8_t*) &U2TXREG;
14104  destSize = 1;
14105  cellSize = 1;
14106  // User registers an event handler with system service. This is done once
14107  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14108  (uintptr_t)&myAppObj);
14109  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14110  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14111  {
14112  // Error handling here
14113  }
14114  // Event Processing Technique. Event is received when
14115  // the transfer is processed.
14116  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14117  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14118  {
14119  switch(event)
14120  {
14121  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14122  // This means the data was transferred.
14123  break;
14124  case SYS_DMA_TRANSFER_EVENT_ERROR:
14125  // Error handling here.
14126  break;
14127  default:
14128  break;
14129  }
14130  }
14131  </code>
14132  Remarks:
14133  For PIC32MZ series of devices, if the source/destination addresses are
14134  RAM memory addresses, the the source/destination buffers
14135  should be made coherent to avoid the cache coherency issues.
14136  For example:
14137  <code>
14138  uint8_t buffer[1024];
14139  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14140  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14141  </code>
14142 */
14143 
14144 void
14146  SYS_DMA_CHANNEL_HANDLE handle ,
14147  const void * srcAddr ,
14148  size_t srcSize ,
14149  const void * destAddr ,
14150  size_t destSize ,
14151  size_t cellSize ) ;
14152 //******************************************************************************
14153 /* Function:
14154  void SYS_DMA_ChannelTransferSet
14155  (
14156  SYS_DMA_CHANNEL_HANDLE handle,
14157  const void *srcAddr, size_t srcSize
14158  const void *destAddr, size_t destSize,
14159  size_t cellSize
14160  )
14161  Summary:
14162  Sets up a data transfer to a DMA channel.
14163  Description:
14164  This function sets up data transfer characteristics for a DMA channel. The
14165  The source and the destination addresses, source and destination lengths,
14166  The number of bytes transferred per cell event are set.
14167  This function does not enables the DMA channel. The channel has to be explicitly
14168  enabled to start the data transfer.
14169  The above functions could be used in situations where in the user intends to
14170  setup transfer parameters but do not intend to enable the channel immediately.
14171  For example to chain to DMA channels in a cyclic order where the channels remains
14172  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14173  condition occurs.
14174  Precondition:
14175  DMA should have been initialized by calling SYS_DMA_Initialize.
14176  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14177  The function SYS_DMA_ChannelSetup must have been called to setup and
14178  enable the required features.
14179  Parameters:
14180  handle - Handle of the DMA channel as returned by the
14181  SYS_DMA_ChannelAllocate function.
14182  srcAddr - Source of the DMA transfer
14183  srcSize - Size of the source
14184  destAddr - Destination of the DMA transfer
14185  destSize - Size of the destination
14186  cellSize - Size of the cell
14187  Returns:
14188  None.
14189  Example:
14190  <code>
14191  // Set up 10 bytes of data transfer to UART TX
14192  // 'handle' is a valid handle returned
14193  // by the SYS_DMA_ChannelAllocate function.
14194  MY_APP_OBJ myAppObj;
14195  uint8_t buf[10];
14196  void *srcAddr;
14197  void *destAddr;
14198  size_t srcSize;
14199  size_t destSize;
14200  size_t cellSize;
14201  srcAddr = (uint8_t *) buf;
14202  srcSize = 10;
14203  destAddr = (uin8_t*) &U2TXREG;
14204  destSize = 1;
14205  cellSize = 1;
14206  // User registers an event handler with system service. This is done once
14207  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14208  (uintptr_t)&myAppObj);
14209  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14210  SYS_DMA_ChannelEnable(handle);
14211  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14212  {
14213  // Error handling here
14214  }
14215  // Event Processing Technique. Event is received when
14216  // the transfer is processed.
14217  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14218  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14219  {
14220  switch(event)
14221  {
14222  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14223  // This means the data was transferred.
14224  break;
14225  case SYS_DMA_TRANSFER_EVENT_ERROR:
14226  // Error handling here.
14227  break;
14228  default:
14229  break;
14230  }
14231  }
14232  </code>
14233  Remarks:
14234  For PIC32MZ series of devices, if the source/destination addresses are
14235  RAM memory addresses, the the source/destination buffers
14236  should be made coherent to avoid the cache coherency issues.
14237  For example:
14238  <code>
14239  uint8_t buffer[1024];
14240  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14241  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14242  </code>
14243 */
14244 
14245 void
14247  SYS_DMA_CHANNEL_HANDLE handle ,
14248  const void * srcAddr ,
14249  size_t srcSize ,
14250  const void * destAddr ,
14251  size_t destSize ,
14252  size_t cellSize ) ;
14253 //******************************************************************************
14254 /* Function:
14255  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14256  Summary:
14257  Returns the number of bytes transferred from source.
14258  Description:
14259  When a data transfer request is submitted. At any time while the transmission
14260  is in progress the size of the amount of data transferred from source
14261  can be known by calling this function.
14262  Precondition:
14263  DMA should have been initialized by calling SYS_DMA_Initialize.
14264  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14265  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14266  SYS_DMA_ChannelTransferSet.
14267  Parameters:
14268  handle - A valid channel handle, returned from the system service's
14269  Allocate routine
14270  Returns:
14271  size_t - Returns the number of bytes transferred from the submitted size.
14272  Example:
14273  <code>
14274  // 'handle' is a valid handle returned
14275  // by the SYS_DMA_ChannelAllocate function.
14276  MY_APP_OBJ myAppObj;
14277  uint8_t buf[10];
14278  void *srcAddr;
14279  void *destAddr;
14280  size_t srcSize;
14281  size_t destSize;
14282  size_t cellSize;
14283  size_t transferredSize;
14284  srcAddr = (uint8_t *) buf;
14285  srcSize = 10;
14286  destAddr = (uin8_t*) &U2TXREG;
14287  destSize = 1;
14288  cellSize = 1;
14289  channelHandle = SYS_DMA_ChannelAllocate(channel);
14290  // User registers an event handler with system service. This is done once
14291  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14292  (uintptr_t)&myAppObj);
14293  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14294  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14295  {
14296  // Error handling here
14297  }
14298  // The data is being transferred after adding the transfer to the DMA channel.
14299  // The user can get to know dynamically the amount of data
14300  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14301  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14302  </code>
14303  Remarks:
14304  None.
14305 */
14306 
14307 size_t
14309  SYS_DMA_CHANNEL_HANDLE handle ) ;
14310 //******************************************************************************
14311 /* Function:
14312  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14313  Summary:
14314  Returns the number of bytes transferred to destination.
14315  Description:
14316  When a data transfer request is submitted. At any time while the transmission
14317  is in progress the size of the amount of data transferred to destination
14318  can be known by calling this function.
14319  Precondition:
14320  DMA should have been initialized by calling SYS_DMA_Initialize.
14321  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14322  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14323  SYS_DMA_ChannelTransferSet.
14324  Parameters:
14325  handle - A valid channel handle, returned from the system service's
14326  Allocate routine
14327  Returns:
14328  size_t - Returns the number of bytes received from the submitted size.
14329  Example:
14330  <code>
14331  // 'handle' is a valid handle returned
14332  // by the SYS_DMA_ChannelAllocate function.
14333  MY_APP_OBJ myAppObj;
14334  uint8_t buf[10];
14335  void *srcAddr;
14336  void *destAddr;
14337  size_t srcSize;
14338  size_t destSize;
14339  size_t cellSize;
14340  size_t transferredSize;
14341  srcAddr = (uin8_t*) &U2RXREG;
14342  srcSize = 1;
14343  destAddr = (uint8_t *) buf ;
14344  destSize = 10;
14345  cellSize = 1;
14346  channelHandle = SYS_DMA_ChannelAllocate(channel);
14347  // User registers an event handler with system service. This is done once
14348  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14349  (uintptr_t)&myAppObj);
14350  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14351  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14352  {
14353  // Error handling here
14354  }
14355  // The data is being transferred after adding the transfer to the DMA channel.
14356  // The user can get to know dynamically the amount of data
14357  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14358  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14359  </code>
14360  Remarks:
14361  None.
14362 */
14363 
14364 size_t
14366  SYS_DMA_CHANNEL_HANDLE handle ) ;
14367 //******************************************************************************
14368 /*
14369  Function:
14370  void SYS_DMA_ChannelTransferEventHandlerSet
14371  (
14372  SYS_DMA_CHANNEL_HANDLE handle,
14373  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14374  const uintptr_t contextHandle
14375  )
14376  Summary:
14377  This function allows a DMA system service client to set an event handler.
14378  Description:
14379  This function allows a client to set an event handler. The client may want
14380  to receive transfer related events in cases when it uses non-blocking read and
14381  write functions. The event handler should be set before the client
14382  intends to perform operations that could generate events.
14383  This function accepts a contextHandle parameter. This parameter could be
14384  set by the client to contain (or point to) any client specific data object
14385  that should be associated with this DMA channel.
14386  Precondition:
14387  DMA should have been initialized by calling SYS_DMA_Initialize.
14388  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14389  Parameters:
14390  handle - A valid channel handle, returned from the system service's
14391  Allocate routine
14392  eventHandler - Pointer to the event handler function.
14393  contextHandle - Value identifying the context of the application/driver/middleware
14394  that registered the event handling function.
14395  Returns:
14396  None.
14397  Example:
14398  <code>
14399  // 'handle' is a valid handle returned
14400  // by the SYS_DMA_ChannelAllocate function.
14401  MY_APP_OBJ myAppObj;
14402  uint8_t buf[10];
14403  void *srcAddr;
14404  void *destAddr;
14405  size_t srcSize;
14406  size_t destSize;
14407  size_t cellSize;
14408  srcAddr = (uint8_t *) buf;
14409  srcSize = 10;
14410  destAddr = (uin8_t*) &U2TXREG;
14411  destSize = 1;
14412  cellSize = 1;
14413  channelHandle = SYS_DMA_ChannelAllocate(channel);
14414  // User registers an event handler with system service. This is done once
14415  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14416  (uintptr_t)&myAppObj);
14417  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14418  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14419  {
14420  // Error handling here
14421  }
14422  // Event Processing Technique. Event is received when
14423  // the transfer is processed.
14424  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14425  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14426  {
14427  switch(event)
14428  {
14429  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14430  // This means the data was transferred.
14431  break;
14432  case SYS_DMA_TRANSFER_EVENT_ERROR:
14433  // Error handling here.
14434  break;
14435  default:
14436  break;
14437  }
14438  }
14439  </code>
14440  Remarks:
14441  None.
14442  */
14443 
14444 void
14446  SYS_DMA_CHANNEL_HANDLE handle ,
14447  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14448  const uintptr_t contextHandle ) ;
14449 // *****************************************************************************
14450 /* Function:
14451  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14452  Summary:
14453  This function returns the error(if any) associated with the last client
14454  request.
14455  Description:
14456  This function returns the error(if any) associated with the last client
14457  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14458  the client can call this function to know the error cause.
14459  The error status will be updated on every operation and should be read
14460  frequently (ideally immediately after the service operation has completed)
14461  to know the relevant error status.
14462  Precondition:
14463  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14464  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14465  handle.
14466  Parameters:
14467  handle - Handle of the DMA channel as returned by the
14468  SYS_DMA_ChannelAllocate function.
14469  Returns:
14470  A SYS_DMA_ERROR type indicating last known error status.
14471  Example:
14472  <code>
14473  // 'handle' is a valid handle returned
14474  // by the SYS_DMA_ChannelAllocate function.
14475  // pDmaSrc, pDmaDst is the source,destination address
14476  // txferSrcSize, txferDesSize is the source,destination transfer size
14477  // cellSize is the cell size
14478  MY_APP_OBJ myAppObj;
14479  // Client registers an event handler with service. This is done once
14480  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14481  (uintptr_t)&myAppObj );
14482  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14483  DMA_TRIGGER_SOURCE_NONE);
14484  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14485  pDmaDst,txferDesSize,cellSize);
14486  SYS_DMA_ChannelForceStart(handle);
14487  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14488  {
14489  // Error handling here
14490  }
14491  // Event Processing Technique. Event is received when
14492  // the transfer is processed.
14493  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14494  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14495  {
14496  switch(event)
14497  {
14498  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14499  // This means the data was transferred.
14500  break;
14501  case SYS_DMA_TRANSFER_EVENT_ERROR:
14502  // Error handling here.
14503  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14504  {
14505  // There was an address error.
14506  // Do error handling here.
14507  }
14508  break;
14509  default:
14510  break;
14511  }
14512  }
14513  </code>
14514  Remarks:
14515  It is the client's responsibility to make sure that the error status is
14516  obtained frequently. The service will update the error status
14517  regardless of whether this has been examined by the client.
14518 */
14519 
14522  SYS_DMA_CHANNEL_HANDLE handle ) ;
14523 //******************************************************************************
14524 /* Function:
14525  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14526  Summary:
14527  Force start of transfer on the selected channel.
14528  Description:
14529  The function force start a DMA transfer to occur for the selected channel.
14530  Precondition:
14531  DMA should have been initialized by calling SYS_DMA_Initialize.
14532  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14533  The function SYS_DMA_ChannelSetup must have been called to setup and
14534  enable the required features.
14535  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14536  Parameters:
14537  handle - Handle of the DMA channel as returned by the
14538  SYS_DMA_ChannelAllocate function.
14539  Returns:
14540  None.
14541  Example:
14542  <code>
14543  // 'handle' is a valid handle returned
14544  // by the SYS_DMA_ChannelAllocate function.
14545  // pDmaSrc, pDmaDst is the source,destination address
14546  // txferSrcSize, txferDesSize is the source,destination transfer size
14547  // cellSize is the cell size
14548  MY_APP_OBJ myAppObj;
14549  // Client registers an event handler with service. This is done once
14550  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14551  (uintptr_t)&myAppObj );
14552  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14553  DMA_TRIGGER_SOURCE_NONE);
14554  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14555  pDmaDst,txferDesSize,cellSize);
14556  SYS_DMA_ChannelForceStart(handle);
14557  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14558  {
14559  // Error handling here
14560  }
14561  // Event Processing Technique. Event is received when
14562  // the transfer is processed.
14563  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14564  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14565  {
14566  switch(event)
14567  {
14568  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14569  // This means the data was transferred.
14570  break;
14571  case SYS_DMA_TRANSFER_EVENT_ERROR:
14572  // Error handling here.
14573  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14574  {
14575  // There was an address error.
14576  // Do error handling here.
14577  }
14578  break;
14579  default:
14580  break;
14581  }
14582  }
14583  </code>
14584  Remarks:
14585  This function must be used to start the DMA transfer when the channel has been
14586  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14587 */
14588 
14589 void
14591  SYS_DMA_CHANNEL_HANDLE handle ) ;
14592 //******************************************************************************
14593 /* Function:
14594  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14595  Summary:
14596  Force abort of transfer on the selected channel.
14597  Description:
14598  The function aborts a DMA transfer to occur for the selected channel.
14599  Precondition:
14600  DMA should have been initialized by calling SYS_DMA_Initialize.
14601  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14602  The function SYS_DMA_ChannelSetup must have been called to setup and
14603  enable the required features.
14604  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14605  Parameters:
14606  handle - Handle of the DMA channel as returned by the
14607  SYS_DMA_ChannelAllocate function.
14608  Returns:
14609  None.
14610  Example:
14611  <code>
14612  // 'handle' is a valid handle returned
14613  // by the SYS_DMA_ChannelAllocate function.
14614  // pDmaSrc, pDmaDst is the source,destination address
14615  // txferSrcSize, txferDesSize is the source,destination transfer size
14616  // cellSize is the cell size
14617  MY_APP_OBJ myAppObj;
14618  // Client registers an event handler with service. This is done once
14619  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14620  (uintptr_t)&myAppObj );
14621  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14622  DMA_TRIGGER_SOURCE_NONE);
14623  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14624  pDmaDst,txferDesSize,cellSize);
14625  SYS_DMA_ChannelForceStart(handle);
14626  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14627  {
14628  // Error handling here
14629  }
14630  ....
14631  ....
14632  // Client may need to abort a transfer
14633  SYS_DMA_ChannelForceAbort(handle);
14634  // Event Processing Technique. Event is received when
14635  // the transfer is processed.
14636  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14637  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14638  {
14639  switch(event)
14640  {
14641  case SYS_DMA_TRANSFER_EVENT_ABORT:
14642  // This means the data was transferred.
14643  break;
14644  case SYS_DMA_TRANSFER_EVENT_ERROR:
14645  // Error handling here.
14646  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14647  {
14648  // There was an address error.
14649  // Do error handling here.
14650  }
14651  break;
14652  default:
14653  break;
14654  }
14655  }
14656  </code>
14657  Remarks:
14658  This function must be used to abort the DMA transfer when the channel has been
14659  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14660  and SYS_DMA_ChannelAbortEventSet has not been called.
14661 */
14662 
14663 void
14665  SYS_DMA_CHANNEL_HANDLE handle ) ;
14666 //******************************************************************************
14667 /* Function:
14668  void SYS_DMA_ChannelAbortEventSet
14669  (
14670  SYS_DMA_CHANNEL_HANDLE handle,
14671  DMA_TRIGGER_SOURCE eventSrc
14672  )
14673  Summary:
14674  Sets an event source and enables cell transfer abort event for the same
14675  for the selected channel.
14676  Description:
14677  This functions enables a cell transfer abort event for the selected source
14678  event.
14679  Precondition:
14680  DMA should have been initialized by calling SYS_DMA_Initialize.
14681  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14682  The function SYS_DMA_ChannelSetup must have been called to setup and
14683  enable the required features.
14684  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14685  Parameters:
14686  handle - Handle of the DMA channel as returned by the
14687  SYS_DMA_ChannelAllocate function.
14688  eventSrc - The event causing the cell transfer abort
14689  Returns:
14690  None.
14691  Example:
14692  <code>
14693  // 'handle' is a valid handle returned
14694  // by the SYS_DMA_ChannelAllocate function.
14695  // pDmaSrc, pDmaDst is the source,destination address
14696  // txferSrcSize, txferDesSize is the source,destination transfer size
14697  // cellSize is the cell size
14698  MY_APP_OBJ myAppObj;
14699  // Client registers an event handler with service. This is done once
14700  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14701  (uintptr_t)&myAppObj );
14702  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14703  DMA_TRIGGER_SOURCE_NONE);
14704  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14705  pDmaDst,txferDesSize,cellSize);
14706  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
14707  SYS_DMA_ChannelForceStart(handle);
14708  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14709  {
14710  // Error handling here
14711  }
14712  // Event Processing Technique. Event is received when
14713  // the transfer is processed.
14714  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14715  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14716  {
14717  switch(event)
14718  {
14719  case SYS_DMA_TRANSFER_EVENT_ABORT:
14720  // This means the data was transferred.
14721  break;
14722  case SYS_DMA_TRANSFER_EVENT_ERROR:
14723  // Error handling here.
14724  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14725  {
14726  // There was an address error.
14727  // Do error handling here.
14728  }
14729  break;
14730  default:
14731  break;
14732  }
14733  }
14734  </code>
14735  Remarks:
14736  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
14737  current DMA transfer will be aborted. The behavior is a same as calling
14738  SYS_DMA_ChannelForceAbort.
14739 */
14740 
14741 void
14743  SYS_DMA_CHANNEL_HANDLE handle ,
14744  DMA_TRIGGER_SOURCE eventSrc ) ;
14745 //******************************************************************************
14746 /* Function:
14747  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
14748  Summary:
14749  Returns the busy status of the specified DMA channel.
14750  Description:
14751  This function returns the busy status of the selected DMA channel
14752  Precondition:
14753  DMA should have been initialized by calling SYS_DMA_Initialize.
14754  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14755  Parameters:
14756  handle - Handle of the DMA channel as returned by the
14757  SYS_DMA_ChannelAllocate function.
14758  Returns:
14759  bool - true, if the selected DMA channel is active or enabled
14760  - false, if the selected DMA channel is inactive or disabled
14761  Example:
14762  <code>
14763  bool busyStat;
14764  busyStat = SYS_DMA_ChannelGetBusy(handle);
14765  </code>
14766  Remarks:
14767  This feature may not be available on all devices. Refer to the specific device
14768  data sheet to determine availability.
14769 */
14770 
14771 bool
14773  SYS_DMA_CHANNEL_HANDLE handle ) ;
14774 //******************************************************************************
14775 /* Function:
14776  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
14777  Summary:
14778  Suspend DMA operation on the specified DMA channel.
14779  Description:
14780  This function suspends the DMA operation on the DMA channel
14781  specified by the channel handle.
14782  Precondition:
14783  DMA should have been initialized by calling SYS_DMA_Initialize.
14784  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14785  Parameters:
14786  handle - Handle of the DMA channel as returned by the
14787  SYS_DMA_ChannelAllocate function.
14788  Returns:
14789  None.
14790  Example:
14791  <code>
14792  SYS_DMA_ChannelSuspend(handle);
14793  </code>
14794  Remarks:
14795  This feature may not be available on all devices. Refer to the specific device
14796  data sheet to determine availability.
14797 */
14798 
14799 void
14801  SYS_DMA_CHANNEL_HANDLE handle ) ;
14802 //******************************************************************************
14803 /* Function:
14804  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
14805  Summary:
14806  Resume DMA operation on the specified DMA channel.
14807  Description:
14808  This function resumes the DMA operation on the DMA channel
14809  specified by the channel handle.
14810  Precondition:
14811  DMA should have been initialized by calling SYS_DMA_Initialize.
14812  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14813  Parameters:
14814  handle - Handle of the DMA channel as returned by the
14815  SYS_DMA_ChannelAllocate function.
14816  Returns:
14817  None.
14818  Example:
14819  <code>
14820  SYS_DMA_ChannelResume(handle);
14821  </code>
14822  Remarks:
14823  This feature may not be available on all devices. Refer to the specific device
14824  data sheet to determine availability.
14825 */
14826 
14827 void
14829  SYS_DMA_CHANNEL_HANDLE handle ) ;
14830 // *****************************************************************************
14831 // *****************************************************************************
14832 // Section: Global DMA Management Functions
14833 // *****************************************************************************
14834 // *****************************************************************************
14835 //******************************************************************************
14836 /* Function:
14837  void SYS_DMA_Suspend(void)
14838  Summary:
14839  Suspend DMA transfers.
14840  Description:
14841  This function suspends DMA transfers to allow CPU uninterrupted access
14842  to data bus
14843  Precondition:
14844  DMA should have been initialized by calling SYS_DMA_Initialize.
14845  Parameters:
14846  None.
14847  Returns:
14848  None.
14849  Example:
14850  <code>
14851  SYS_DMA_Suspend();
14852  </code>
14853  Remarks:
14854  None
14855 */
14856 
14857 void
14858  SYS_DMA_Suspend ( void ) ;
14859 //******************************************************************************
14860 /* Function:
14861  void SYS_DMA_Resume(void)
14862  Summary:
14863  Resume DMA operations.
14864  Description:
14865  This function disables DMA suspend. It resumes the DMA operation suspended
14866  by calling SYS_DMA_Suspend. The DMA operates normally.
14867  Precondition:
14868  DMA should have been initialized by calling SYS_DMA_Initialize.
14869  Parameters:
14870  None.
14871  Returns:
14872  None.
14873  Example:
14874  <code>
14875  SYS_DMA_Resume();
14876  </code>
14877  Remarks:
14878  None
14879 */
14880 
14881 void
14882  SYS_DMA_Resume ( void ) ;
14883 //******************************************************************************
14884 /* Function:
14885  bool SYS_DMA_IsBusy(void)
14886  Summary:
14887  Returns the busy status of the DMA module.
14888  Description:
14889  This function returns the busy status of the DMA module
14890  Precondition:
14891  DMA should have been initialized by calling SYS_DMA_Initialize.
14892  Parameters:
14893  None.
14894  Returns:
14895  Boolean
14896  - true - The DMA module is active
14897  - false - The DMA module is inactive and disabled
14898  <code>
14899  bool busyStat;
14900  busyStat = SYS_DMA_IsBusy();
14901  </code>
14902  Remarks:
14903  This feature may not be available on all devices. Refer to the specific device
14904  data sheet to determine availability.
14905 */
14906 
14907 bool
14908  SYS_DMA_IsBusy ( void ) ;
14909 // *****************************************************************************
14910 // *****************************************************************************
14911 // Section: Deprecated functions
14912 // *****************************************************************************
14913 // *****************************************************************************
14914 //*******************************************************************************
14915 /* Function:
14916  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14917  Summary:
14918  This function is deprecated. Use SYS_DMA_Tasks function.
14919  */
14920 
14921 void
14922  SYS_DMA_Tasks (
14923  SYS_MODULE_OBJ object ,
14924  DMA_CHANNEL activeChannel ) ;
14925 //*****************************************************************************
14926 /* Function:
14927  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
14928  Summary:
14929  This function is deprecated. Use SYS_DMA_Tasks function.
14930  */
14931 
14932 void
14934  SYS_MODULE_OBJ object ) ;
14935 //*******************************************************************************
14936 /* Function:
14937  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14938  Summary:
14939  This function is deprecated. Use SYS_DMA_Tasks function.
14940  */
14941 
14942 void
14944  SYS_MODULE_OBJ object ,
14945  DMA_CHANNEL activeChannel ) ;
14946  // #ifndef _SYS_DMA_H
14947 /*******************************************************************************
14948  End of File
14949 */
14950 
14951 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
14952 /* CLOSE_FILE Include File */
14953 
14954 // DOM-IGNORE-BEGIN
14955 // DOM-IGNORE-END
14956 // *****************************************************************************
14957 // *****************************************************************************
14958 // Section: Data Types
14959 // *****************************************************************************
14960 // *****************************************************************************
14961 // *****************************************************************************
14962 /* Driver USART Module Index
14963  Summary:
14964  USART driver index definitions
14965  Description:
14966  These constants provide USART driver index definitions.
14967  Remarks:
14968  These constants should be used in place of hard-coded numeric literals.
14969  These values should be passed into the DRV_USART_Initialize and
14970  DRV_USART_Open routines to identify the driver instance in use.
14971 */
14972 #define DRV_USART_INDEX_0 0
14973 #define DRV_USART_INDEX_1 1
14974 #define DRV_USART_INDEX_2 2
14975 #define DRV_USART_INDEX_3 3
14976 #define DRV_USART_INDEX_4 4
14977 #define DRV_USART_INDEX_5 5
14978 // *****************************************************************************
14979 /* USART Driver Module Count
14980  Summary:
14981  Number of valid USART drivers
14982  Description:
14983  This constant identifies the maximum number of USART Driver instances that
14984  should be defined in the system. Defining more instances than this
14985  constant will waste RAM memory space.
14986  This constant can also be used by the system and application to identify the
14987  number of USART instances on this microcontroller.
14988  Remarks:
14989  This value is part-specific.
14990 */
14991 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
14992 // *****************************************************************************
14993 /* USART Driver Write Error
14994  Summary:
14995  USART Driver Write Error.
14996  Description:
14997  This constant is returned by DRV_USART_Write() function when an error
14998  occurs.
14999  Remarks:
15000  None.
15001 */
15002 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
15003 // *****************************************************************************
15004 /* USART Driver Read Error
15005  Summary:
15006  USART Driver Read Error.
15007  Description:
15008  This constant is returned by DRV_USART_Read() function when an error
15009  occurs.
15010  Remarks:
15011  None.
15012 */
15013 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
15014 // *****************************************************************************
15015 /* USART Driver Buffer Handle
15016  Summary:
15017  Handle identifying a read or write buffer passed to the driver.
15018  Description:
15019  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
15020  or DRV_USART_BufferAddWrite functions. This handle is associated with the
15021  buffer passed into the function and it allows the application to track the
15022  completion of the data from (or into) that buffer. The buffer handle value
15023  returned from the "buffer add" function is returned back to the client
15024  by the "event handler callback" function registered with the driver.
15025  The buffer handle assigned to a client request expires when the client has
15026  been notified of the completion of the buffer transfer (after event handler
15027  function that notifies the client returns) or after the buffer has been
15028  retired by the driver if no event handler callback was set.
15029  Remarks:
15030  None
15031 */
15032 
15033 typedef
15034 uintptr_t
15036 // *****************************************************************************
15037 /* USART Driver Invalid Buffer Handle
15038  Summary:
15039  Definition of an invalid buffer handle.
15040  Description:
15041  This is the definition of an invalid buffer handle. An invalid buffer handle
15042  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
15043  functions if the buffer add request was not successful.
15044  Remarks:
15045  None
15046 */
15047 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
15048 // *****************************************************************************
15049 /* USART Modes of Operation
15050  Summary:
15051  Identifies the modes of the operation of the USART module
15052  Description:
15053  This data type identifies the modes of the operation of the USART module.
15054  Remarks:
15055  Not all modes are available on all devices. Refer to the specific device data
15056  sheet to determine availability.
15057 */
15058 
15059 typedef
15060  enum
15061  {
15062  /* USART works in IRDA mode */
15064  /* This is the normal point to point communication mode where the USART
15065  communicates directly with another USART by connecting it's Transmit signal
15066  to the external USART's Receiver signal and vice versa. An external
15067  transceiver may be connected to obtain RS-232 signal levels. This type of
15068  connection is typically full duplex. */
15070  /* This is a multi-point bus mode where the USART can communicate with
15071  many other USARTS on a bus using an address-based protocol such as RS-485.
15072  This mode is typically half duplex and the physical layer may require a
15073  transceiver. In this mode every USART on the bus is assigned an address and
15074  the number of data bits is 9 bits */
15076  /* Loopback mode internally connects the Transmit signal to the Receiver
15077  signal, looping data transmission back into this USART's own input. It is
15078  useful primarily as a test mode. */
15081 // *****************************************************************************
15082 /* USART Driver Buffer Events
15083  Summary
15084  Identifies the possible events that can result from a buffer add request.
15085  Description
15086  This enumeration identifies the possible events that can result from a
15087  buffer add request caused by the client calling either the
15088  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
15089  Remarks:
15090  One of these values is passed in the "event" parameter of the event
15091  handling callback function that the client registered with the driver by
15092  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15093  transfer request is completed.
15094 */
15095 
15096 typedef
15097  enum
15098  {
15099  /* All data from or to the buffer was transferred successfully. */
15101  /* There was an error while processing the buffer transfer request. */
15103  /* Data transfer aborted (Applicable in DMA mode) */
15106 // *****************************************************************************
15107 /* USART Driver Buffer Result
15108  Summary
15109  Identifies the possible result of the buffer processing.
15110  Description
15111  This enumeration identifies the possible result of the buffer processing.
15112 
15113  Remarks:
15114  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15115  is in the free buffer pool.
15116 */
15117 
15118 typedef
15119  enum
15120  {
15121  /* Buffer handle is not valid*/
15123  /* Buffer handle has expired. */
15125  /* Buffer is removed from the queue succesfully*/
15127  /* Buffer removal failed because of unable to acquire the mutex
15128  * This is applicable in RTOS mode only */
15131 // *****************************************************************************
15132 /* USART Driver Buffer Event Handler Function Pointer
15133  Summary
15134  Pointer to a USART Driver Buffer Event handler function
15135  Description
15136  This data type defines the required function signature for the USART driver
15137  buffer event handling callback function. A client must register a pointer
15138  to a buffer event handling function whose function signature (parameter
15139  and return value types) match the types specified by this function pointer
15140  in order to receive buffer related event calls back from the driver.
15141  The parameters and return values and are described here and
15142  a partial example implementation is provided.
15143  Parameters:
15144  event - Identifies the type of event
15145  bufferHandle - Handle identifying the buffer to which the vent relates
15146  context - Value identifying the context of the application that registered
15147  the event handling function.
15148  Returns:
15149  None.
15150  Example:
15151  <code>
15152  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15153  DRV_USART_BUFFER_HANDLE bufferHandle,
15154  uintptr_t context )
15155  {
15156  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15157  switch(event)
15158  {
15159  case DRV_USART_BUFFER_EVENT_COMPLETE:
15160  // Handle the completed buffer.
15161  break;
15162  case DRV_USART_BUFFER_EVENT_ERROR:
15163  default:
15164  // Handle error.
15165  break;
15166  }
15167  }
15168  </code>
15169  Remarks:
15170  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15171  transferred successfully.
15172  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15173  transferred successfully. The DRV_USART_ErrorGet function can be called to
15174  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15175  called to find out how many bytes were processed.
15176  The bufferHandle parameter contains the buffer handle of the buffer that
15177  associated with the event.
15178  The context parameter contains the a handle to the client context,
15179  provided at the time the event handling function was registered using the
15180  DRV_USART_BufferEventHandlerSet function. This context handle value is
15181  passed back to the client as the "context" parameter. It can be any value
15182  necessary to identify the client context or instance (such as a pointer to
15183  the client's data) instance of the client that made the buffer add request.
15184  The event handler function executes in the driver peripheral's interrupt
15185  context when the driver is configured for interrupt mode operation. It is
15186  recommended of the application to not perform process intensive or blocking
15187  operations with in this function.
15188  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15189  be called in the event handler to add a buffer to the driver queue. These
15190  functions can only be called to add buffers to the driver whose event
15191  handler is running. For example, buffers cannot be added USART2 driver in
15192  USART1 driver event handler.
15193 */
15194 
15195 typedef
15197 DRV_USART_BUFFER_HANDLE bufferHandle ,
15198 uintptr_t context ) ;
15199 // *****************************************************************************
15200 /* USART Driver Byte Event Handler Function Pointer
15201  Summary
15202  Pointer to a USART Driver Byte Event handler function
15203  Description
15204  This data type defines the required function signature for the USART driver
15205  byte event handling callback function. A client must register a pointer to a
15206  byte event handling function whose function signature (parameter and return
15207  value types) match the types specified by this function pointer in order to
15208  receive byte related event calls back from the driver.
15209  Parameters:
15210  index - Identifier for the instance
15211  Returns:
15212  None.
15213  Example:
15214  <code>
15215  void APP_MyUsartTxEventHandler(void)
15216  {
15217  // Handle the transmit byte event
15218  }
15219  </code>
15220  Remarks:
15221  The event handler function executes in the driver peripheral's interrupt
15222  context when the driver is configured for interrupt mode operation. It is
15223  recommended that the application not perform process intensive or blocking
15224  operations with in this function.
15225 */
15226 
15227 typedef
15228 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15229 // *****************************************************************************
15230 /* USART Handshake Modes
15231  Summary:
15232  Identifies the handshaking modes supported by the USART driver.
15233  Description:
15234  This data type identifies the handshaking modes supported by the USART
15235  driver.
15236  Remarks:
15237  Not all modes are available on all devices. Refer to the specific device data
15238  sheet to determine availability.
15239 */
15240 
15241 typedef
15242  enum
15243  {
15244  /* Handshaking occurs in Flow Control Mode */
15245  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15246  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15247  ,
15248  /* Handshaking occurs in Simplex Mode */
15249  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15250  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15251  ,
15252  /* No Handshaking */
15253  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15254  2 /*DOM-IGNORE-END*/
15256 // *****************************************************************************
15257 /* USART Baud Set Result
15258  Summary:
15259  Identifies the results of the baud set function.
15260  Description:
15261  This data type identifies the results of the DRV_USART_BaudSet function.
15262  Remarks:
15263  None.
15264 */
15265 
15266 typedef
15267  enum
15268  {
15269  /* The driver was not able to change the baud */
15270  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15271  - 1 /*DOM-IGNORE-END*/
15272  ,
15273  /* The driver was able to change the baud successfully */
15276 // *****************************************************************************
15277 /* USART Line Control Set Result
15278  Summary:
15279  Identifies the results of the baud set function.
15280  Description:
15281  This data type identifies the results of the DRV_USART_LineControlSet
15282  function.
15283  Remarks:
15284  None.
15285 */
15286 
15287 typedef
15288  enum
15289  {
15290  /* The driver was not able to change the Line Control */
15291  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15292  - 1 /*DOM-IGNORE-END*/
15293  ,
15294  /* The driver was able to change the Line Control successfully */
15297 // *****************************************************************************
15298 /* USART Line Control Modes
15299  Summary:
15300  Identifies the line control modes supported by the USART driver.
15301  Description:
15302  This data type identifies the line control modes supported by the USART
15303  driver. Line control modes define the number of data bits, parity mode, and
15304  the number of stop bits in a USART transmit and receive frames.
15305  Remarks:
15306  The abbreviations used in the labels for the values of this enumeration
15307  follow the format <data><parity><stop>, where:
15308  <data> is the number of data bits
15309  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15310  added to obtain an even number of bits, or "ODD" for one bit
15311  added to obtain an odd number of bits.
15312  <stop> is the number of Stop bits
15313 */
15314 
15315 typedef
15316  enum
15317  {
15318  /* 8 data bits, no parity bit, 1 stop bit */
15319  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15320  USART_8N1 /* DOM-IGNORE-END*/
15321  ,
15322  /* 9 data bits, no parity bit, 1 stop bit */
15323  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15324  USART_9N1 /* DOM-IGNORE-END*/
15325  ,
15326  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15327  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15328  USART_8E1 /* DOM-IGNORE-END*/
15329  ,
15330  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15331  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15332  USART_8E2 /* DOM-IGNORE-END*/
15333  ,
15334  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15335  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15336  USART_8O1 /* DOM-IGNORE-END*/
15337  ,
15338  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15339  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15340  USART_8O2 /* DOM-IGNORE-END*/
15341  ,
15342  /* 8 data bits, no parity bit, 2 stop bit */
15343  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15344  USART_8N2 /* DOM-IGNORE-END*/
15345  ,
15346  /* 9 data bits, no parity bit, 2 stop bit */
15347  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15348  USART_9N2 /* DOM-IGNORE-END*/
15350 // *****************************************************************************
15351 /* USART Initialization flags
15352  Summary:
15353  Flags identifying features that can be enabled when the driver is
15354  initialized.
15355  Description:
15356  This enumeration defines flags identifying features that can be enabled
15357  when the driver is initialized.
15358  Remarks:
15359  These flags can be logically ORed together. They are passed into the
15360  DRV_USART_Initialize function through the "flags" member of the
15361  DRV_USART_INIT structure.
15362 */
15363 
15364 typedef
15365  enum
15366  {
15367  /* Use this if no flags need to be set */
15368  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15369  0 /*DOM-IGNORE-END*/
15370  ,
15371  /* Flag to enable "wake on start" operation. If supported and enabled,
15372  this feature will allow the USART to wake-up the device when a
15373  Start bit is received. This option should be selected only when the
15374  device is to placed in Sleep mode. Note that enabling this bit will
15375  also cause the first received character to be lost. Refer to the specific
15376  device data sheet for more information. */
15378  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15379  ,
15380  /* Flag to enable auto baud detection. If supported and enabled, this
15381  feature will allow the USART to automatically detect the baud rate in
15382  use. */
15383  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15384  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15385  ,
15386  /* Flag to enable stop in idle. If supported and enabled , this
15387  feature will allow the USART to stop when the CPU enters Idle
15388  mode */
15390  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15392 // *****************************************************************************
15393 /* Operation Mode Initialization Data
15394  Summary:
15395  Defines the initialization data required for different operation modes of
15396  USART.
15397  Description:
15398  This data type defines the initialization data required for different
15399  operation modes of the USART.
15400  Remarks:
15401  None
15402 */
15403 
15404 typedef
15405  union
15406  {
15407  /* Initialization for Addressed mode */
15408  struct
15409  {
15410  /* Address of the device. */
15411  uint8_t address ;
15412  } AddressedModeInit ;
15414 // *****************************************************************************
15415 /* USART Driver Errors.
15416  Summary:
15417  Defines the possible errors that can occur during driver operation.
15418  Description:
15419  This data type defines the possible errors that can occur when occur during
15420  USART driver operation. These values are returned by DRV_USART_ErrorGet
15421  function.
15422  Remarks:
15423  None
15424 */
15425 
15426 typedef
15427  enum
15428  {
15429  /* There was no error */
15431  /*DOM-IGNORE-BEGIN*/
15432  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15433  ,
15434  /* This indicates that a parity error has occurred */
15436  /*DOM-IGNORE-BEGIN*/
15437  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15438  ,
15439  /* This indicates that a framing error has occurred */
15441  /*DOM-IGNORE-BEGIN*/
15442  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15443  ,
15444  /* This indicates a receiver overflow has occurred */
15446  /*DOM-IGNORE-BEGIN*/
15447  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15448  ,
15449  /* Channel address error (Applicable in DMA mode) */
15450  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15451  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15452  } DRV_USART_ERROR ;
15453 // *****************************************************************************
15454 /* USART Client-Specific Driver Status
15455  Summary:
15456  Defines the client-specific status of the USART driver.
15457  Description:
15458  This enumeration defines the client-specific status codes of the USART
15459  driver.
15460  Remarks:
15461  Returned by the DRV_USART_ClientStatus function.
15462 */
15463 
15464 typedef
15465  enum
15466  {
15467  /* An error has occurred.*/
15469  /* The driver is closed, no operations for this client are ongoing,
15470  and/or the given handle is invalid. */
15472  /* The driver is currently busy and cannot start additional operations. */
15474  /* The module is running and ready for additional operations */
15477 // *****************************************************************************
15478 /* USART Driver Transfer Flags
15479  Summary
15480  Specifies the status of the receive or transmit
15481  Description
15482  This type specifies the status of the receive or transmit operation.
15483  Remarks:
15484  More than one of these values may be OR'd together to create a complete
15485  status value. To test a value of this type, the bit of interest must be
15486  ANDed with the value and checked to see if the result is non-zero.
15487 */
15488 
15489 typedef
15490  enum
15491  {
15492  /* Indicates that at least one byte of Data has been received */
15494  /*DOM-IGNORE-BEGIN*/
15495  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15496  ,
15497  /* Indicates that the core driver receiver buffer is empty */
15499  /*DOM-IGNORE-BEGIN*/
15500  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15501  ,
15502  /* Indicates that the core driver transmitter buffer is full */
15504  /*DOM-IGNORE-BEGIN*/
15505  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15506  ,
15507  /* Indicates that the core driver transmitter buffer is empty */
15509  /*DOM-IGNORE-BEGIN*/
15510  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15512 // *****************************************************************************
15513 /* USART Driver Initialization Data
15514  Summary:
15515  Defines the data required to initialize or reinitialize the USART driver
15516  Description:
15517  This data type defines the data required to initialize or reinitialize the
15518  USART driver. If the driver is built statically, the members of this data
15519  structure are statically over-ridden by static override definitions in the
15520  system_config.h file.
15521  Remarks:
15522  None.
15523 */
15524 
15525 typedef
15526  struct
15527  {
15528  /* System module initialization data */
15529  SYS_MODULE_INIT moduleInit ;
15530  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15531  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15532  system_config.h header file. */
15533  USART_MODULE_ID usartID ;
15534  /* Identifies the Operation mode of the USART driver. For a static build of
15535  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15536  system_config.h header file. */
15538  /* Data required by the operation mode of the driver. For a static build of
15539  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15540  system_config.h header file. */
15542  /* Flags to enable specific features. Refer to the
15543  description of DRV_USART_INIT_FLAGS for more details. For a static build
15544  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15545  system_config.h header file. */
15547  /* USART module Baud Rate Generator Clock. This typically
15548  the peripheral bus clock frequency. For a static build of the driver,
15549  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15550  header file. */
15551  uint32_t brgClock ;
15552  /* The initial USART line control settings. For a static build of the driver
15553  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15554  system_config.h header file. */
15556  /* Baud Rate value to be used, if not using auto baud. For a static build of
15557  the driver, this is overridden by the DRV_USART_BAUD macro in the
15558  system_config.h header file. */
15559  uint32_t baud ;
15560  /* Handshaking mode. For a static build of the driver, this is overridden by
15561  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15563  /* Lines enabled for the USART operation. For a static build of the driver,
15564  this is overridden by the DRV_USART_LINES_ENABLE macro in
15565  the system_config.h header file.
15566  For PPS parts, pin selection in ports overrides this. */
15567  USART_OPERATION_MODE linesEnable ;
15568  /* Interrupt source ID for the transmitter interrupt. For a static build of
15569  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15570  macro in the system_config.h header. */
15571  INT_SOURCE interruptTransmit ;
15572  /* Interrupt source ID for the receiver interrupt. For a static build of
15573  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15574  macro in the system_config.h header. */
15575  INT_SOURCE interruptReceive ;
15576  /* Interrupt source ID for the error Interrupt. For a static build of the
15577  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15578  in the system_config.h header. */
15579  INT_SOURCE interruptError ;
15580  /* This is the receive buffer queue size. This is the maximum
15581  number of read requests that driver will queue. For a
15582  static build of the driver, this is overridden by the
15583  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15584  unsigned int queueSizeReceive ;
15585  /* This is the transmit buffer queue size. This is the maximum
15586  number of write requests that driver will queue. For a
15587  static build of the driver, this is overridden by the
15588  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15589  unsigned int queueSizeTransmit ;
15590  /* This is the USART transmit DMA channel.
15591  For a static build of the driver, this is overridden by the
15592  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15593  DMA_CHANNEL dmaChannelTransmit ;
15594  /* This is the USART receive DMA channel.
15595  For a static build of the driver, this is overridden by the
15596  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15597  DMA_CHANNEL dmaChannelReceive ;
15598  /* This is the USART transmit DMA channel interrupt.
15599  For a static build of the driver, this is overridden by the
15600  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15602  /* This is the USART receive DMA channel interrupt.
15603  For a static build of the driver, this is overridden by the
15604  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15605  INT_SOURCE dmaInterruptReceive ;
15606  } DRV_USART_INIT ;
15607 //DOM-IGNORE-BEGIN
15608 //DOM-IGNORE-END
15609  // #ifndef _DRV_USART_DEFINITIONS_H
15610 /*******************************************************************************
15611  End of File
15612 */
15613 
15614 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15615 /* CLOSE_FILE Include File */
15616 
15617 // DOM-IGNORE-BEGIN
15618 // DOM-IGNORE-END
15619 // *****************************************************************************
15620 // *****************************************************************************
15621 // Section: USART Driver Module Interface Routines
15622 // *****************************************************************************
15623 // *****************************************************************************
15624 // *****************************************************************************
15625 /* Function:
15626  SYS_MODULE_OBJ DRV_USART_Initialize
15627  (
15628  const SYS_MODULE_INDEX index,
15629  const SYS_MODULE_INIT * const init
15630  )
15631  Summary:
15632  Initializes the USART instance for the specified driver index.
15633  <p><b>Implementation:</b> Static/Dynamic</p>
15634  Description:
15635  This routine initializes the USART driver instance for the specified driver
15636  index, making it ready for clients to open and use it. The initialization
15637  data is specified by the init parameter. The initialization may fail if the
15638  number of driver objects allocated are insufficient or if the specified
15639  driver instance is already initialized. The driver instance index is
15640  independent of the USART module ID. For example, driver instance 0 can be
15641  assigned to USART2. If the driver is built statically, then some of the
15642  initialization parameters are overridden by configuration macros. Refer to
15643  the description of the DRV_USART_INIT data structure for more details on
15644  which members on this data structure are overridden.
15645  Precondition:
15646  None.
15647  Parameters:
15648  index - Identifier for the instance to be initialized
15649  init - Pointer to a data structure containing any data necessary to
15650  initialize the driver.
15651  Returns:
15652  If successful, returns a valid handle to a driver instance object.
15653  Otherwise, returns SYS_MODULE_OBJ_INVALID.
15654  Example:
15655  <code>
15656  // The following code snippet shows an example USART driver initialization.
15657  // The driver is initialized for normal mode and a baud of 300. The
15658  // receive queue size is set to 2 and transmit queue size is set to 3.
15659  DRV_USART_INIT usartInit;
15660  SYS_MODULE_OBJ objectHandle;
15661  usartInit.baud = 300;
15662  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
15663  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
15664  usartInit.usartID = USART_ID_2;
15665  usartInit.brgClock = 80000000;
15666  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
15667  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
15668  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
15669  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
15670  usartInit.queueSizeReceive = 2;
15671  usartInit.queueSizeTransmit = 3;
15672  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
15673  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
15674  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
15675  if (SYS_MODULE_OBJ_INVALID == objectHandle)
15676  {
15677  // Handle error
15678  }
15679  </code>
15680  Remarks:
15681  This routine must be called before any other USART routine is called.
15682  This routine should only be called once during system initialization
15683  unless DRV_USART_Deinitialize is called to deinitialize the driver
15684  instance. This routine will NEVER block for hardware access.
15685 */
15686 
15687 SYS_MODULE_OBJ
15689  const SYS_MODULE_INDEX index ,
15690  const SYS_MODULE_INIT * const init ) ;
15691 // *****************************************************************************
15692 /* Function:
15693  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
15694  Summary:
15695  Deinitializes the specified instance of the USART driver module.
15696  <p><b>Implementation:</b> Static/Dynamic</p>
15697  Description:
15698  Deinitializes the specified instance of the USART driver module, disabling
15699  its operation (and any hardware). Invalidates all the internal data.
15700  Precondition:
15701  Function DRV_USART_Initialize should have been called before calling this
15702  function.
15703  Parameters:
15704  object - Driver object handle, returned from the
15705  DRV_USART_Initialize routine
15706  Returns:
15707  None.
15708  Example:
15709  <code>
15710  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15711  SYS_STATUS status;
15712  DRV_USART_Deinitialize(object);
15713  status = DRV_USART_Status(object);
15714  if (SYS_MODULE_DEINITIALIZED != status)
15715  {
15716  // Check again later if you need to know
15717  // when the driver is deinitialized.
15718  }
15719  </code>
15720  Remarks:
15721  Once the Initialize operation has been called, the Deinitialize operation
15722  must be called before the Initialize operation can be called again. This
15723  routine will NEVER block waiting for hardware.
15724 */
15725 
15726 void
15728  SYS_MODULE_OBJ object ) ;
15729 // *****************************************************************************
15730 /* Function:
15731  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
15732  Summary:
15733  Gets the current status of the USART driver module.
15734  <p><b>Implementation:</b> Static/Dynamic</p>
15735  Description:
15736  This routine provides the current status of the USART driver module.
15737  Precondition:
15738  Function DRV_USART_Initialize should have been called before calling this
15739  function.
15740  Parameters:
15741  object - Driver object handle, returned from the
15742  DRV_USART_Initialize routine
15743  Returns:
15744  SYS_STATUS_READY - Indicates that the driver is busy with a
15745  previous system level operation and cannot start
15746  another
15747  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
15748  deinitialized
15749  Example:
15750  <code>
15751  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15752  SYS_STATUS usartStatus;
15753  usartStatus = DRV_USART _Status(object);
15754  if (SYS_STATUS_READY == usartStatus)
15755  {
15756  // This means the driver can be opened using the
15757  // DRV_USART_Open() function.
15758  }
15759  </code>
15760  Remarks:
15761  A driver can opened only when its status is SYS_STATUS_READY.
15762 */
15763 
15764 SYS_STATUS
15766  SYS_MODULE_OBJ object ) ;
15767 // *****************************************************************************
15768 /* Function:
15769  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
15770  Summary:
15771  Maintains the driver's transmit state machine and implements its ISR.
15772  <p><b>Implementation:</b> Static/Dynamic</p>
15773  Description:
15774  This routine is used to maintain the driver's internal transmit state
15775  machine and implement its transmit ISR for interrupt-driven implementations.
15776  In polling mode, this function should be called from the SYS_Tasks
15777  function. In interrupt mode, this function should be called in the transmit
15778  interrupt service routine of the USART that is associated with this USART
15779  driver hardware instance.
15780  Precondition:
15781  The DRV_USART_Initialize routine must have been called for the specified
15782  USART driver instance.
15783  Parameters:
15784  object - Object handle for the specified driver instance (returned from
15785  DRV_USART_Initialize)
15786  Returns:
15787  None.
15788  Example:
15789  <code>
15790  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15791  while (true)
15792  {
15793  DRV_USART_TasksTransmit (object);
15794  // Do other tasks
15795  }
15796  </code>
15797  Remarks:
15798  This routine is normally not called directly by an application. It is
15799  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15800  ISR.
15801  This routine may execute in an ISR context and will never block or access any
15802  resources that may cause it to block.
15803 */
15804 
15805 void
15807  SYS_MODULE_OBJ object ) ;
15808 // *****************************************************************************
15809 /* Function:
15810  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
15811  Summary:
15812  Maintains the driver's receive state machine and implements its ISR.
15813  <p><b>Implementation:</b> Static/Dynamic</p>
15814  Description:
15815  This routine is used to maintain the driver's internal receive state machine
15816  and implement its receive ISR for interrupt-driven implementations. In
15817  polling mode, this function should be called from the SYS_Tasks function.
15818  In interrupt mode, this function should be called in the receive interrupt
15819  service routine of the USART that is associated with this USART driver
15820  hardware instance.
15821  Precondition:
15822  The DRV_USART_Initialize routine must have been called for the specified
15823  USART driver instance.
15824  Parameters:
15825  object - Object handle for the specified driver instance (returned from
15826  DRV_USART_Initialize)
15827  Returns:
15828  None.
15829  Example:
15830  <code>
15831  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15832  while (true)
15833  {
15834  DRV_USART_TasksReceive (object);
15835  // Do other tasks
15836  }
15837  </code>
15838  Remarks:
15839  This routine is normally not called directly by an application. It is
15840  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15841  ISR.
15842  This routine may execute in an ISR context and will never block or access any
15843  resources that may cause it to block.
15844 */
15845 
15846 void
15848  SYS_MODULE_OBJ object ) ;
15849 // *****************************************************************************
15850 /* Function:
15851  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
15852  Summary:
15853  Maintains the driver's error state machine and implements its ISR.
15854  <p><b>Implementation:</b> Static/Dynamic</p>
15855  Description:
15856  This routine is used to maintain the driver's internal error state machine
15857  and implement its error ISR for interrupt-driven implementations. In
15858  polling mode, this function should be called from the SYS_Tasks function.
15859  In interrupt mode, this function should be called in the error interrupt
15860  service routine of the USART that is associated with this USART driver
15861  hardware instance.
15862  Precondition:
15863  The DRV_USART_Initialize routine must have been called for the specified
15864  USART driver instance.
15865  Parameters:
15866  object - Object handle for the specified driver instance (returned from
15867  DRV_USART_Initialize)
15868  Returns:
15869  None.
15870  Example:
15871  <code>
15872  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15873  while (true)
15874  {
15875  DRV_USART_TasksError (object);
15876  // Do other tasks
15877  }
15878  </code>
15879  Remarks:
15880  This routine is normally not called directly by an application. It is
15881  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15882  ISR.
15883  This routine may execute in an ISR context and will never block or access any
15884  resources that may cause it to block.
15885 */
15886 
15887 void
15889  SYS_MODULE_OBJ object ) ;
15890 // *****************************************************************************
15891 // *****************************************************************************
15892 // Section: USART Driver Client Routines
15893 // *****************************************************************************
15894 // *****************************************************************************
15895 // *****************************************************************************
15896 /* Function:
15897  DRV_HANDLE DRV_USART_Open
15898  (
15899  const SYS_MODULE_INDEX index,
15900  const DRV_IO_INTENT ioIntent
15901  )
15902  Summary:
15903  Opens the specified USART driver instance and returns a handle to it.
15904  <p><b>Implementation:</b> Static/Dynamic</p>
15905  Description:
15906  This routine opens the specified USART driver instance and provides a
15907  handle that must be provided to all other client-level operations to
15908  identify the caller and the instance of the driver. The ioIntent
15909  parameter defines how the client interacts with this driver instance.
15910  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
15911  additionally affect the behavior of the DRV_USART_Read and
15912  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
15913  then these function will not block even if the required amount of data could
15914  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
15915  will block until the required amount of data is processed. If the driver is
15916  configured for polling and bare-metal operation, it will not support
15917  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
15918  non-blocking.
15919  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
15920  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
15921  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
15922  client will be able to do both, read and write.
15923  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
15924  exclusive access to this client. The driver cannot be opened by any
15925  other client.
15926  Precondition:
15927  Function DRV_USART_Initialize must have been called before calling this
15928  function.
15929  Parameters:
15930  index - Identifier for the object instance to be opened
15931  intent - Zero or more of the values from the enumeration
15932  DRV_IO_INTENT "ORed" together to indicate the intended use
15933  of the driver. See function description for details.
15934  Returns:
15935  If successful, the routine returns a valid open-instance handle (a number
15936  identifying both the caller and the module instance).
15937  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
15938  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
15939  insufficient.
15940  - if the client is trying to open the driver but driver has been opened
15941  exclusively by another client.
15942  - if the driver hardware instance being opened is not initialized or is
15943  invalid.
15944  - if the client is trying to open the driver exclusively, but has already
15945  been opened in a non exclusive mode by another client.
15946  - if the driver is not ready to be opened, typically when the initialize
15947  routine has not completed execution.
15948  Example:
15949  <code>
15950  DRV_HANDLE handle;
15951  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
15952  if (DRV_HANDLE_INVALID == handle)
15953  {
15954  // Unable to open the driver
15955  // May be the driver is not initialized or the initialization
15956  // is not complete.
15957  }
15958  </code>
15959  Remarks:
15960  The handle returned is valid until the DRV_USART_Close routine is called.
15961  This routine will NEVER block waiting for hardware.If the requested intent
15962  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
15963  function is thread safe in a RTOS application.
15964 */
15965 
15966 DRV_HANDLE
15967  DRV_USART_Open (
15968  const SYS_MODULE_INDEX index ,
15969  const DRV_IO_INTENT ioIntent ) ;
15970 // *****************************************************************************
15971 /* Function:
15972  void DRV_USART_Close( DRV_Handle handle )
15973  Summary:
15974  Closes an opened-instance of the USART driver.
15975  <p><b>Implementation:</b> Static/Dynamic</p>
15976  Description:
15977  This routine closes an opened-instance of the USART driver, invalidating the
15978  handle. Any buffers in the driver queue that were submitted by this client
15979  will be removed. After calling this routine, the handle passed in "handle"
15980  must not be used with any of the remaining driver routines (with one
15981  possible exception described in the "Remarks" section). A new handle must
15982  be obtained by calling DRV_USART_Open before the caller may use the driver
15983  again
15984  Precondition:
15985  The DRV_USART_Initialize routine must have been called for the specified
15986  USART driver instance.
15987  DRV_USART_Open must have been called to obtain a valid opened device handle.
15988  Parameters:
15989  handle - A valid open-instance handle, returned from the driver's
15990  open routine
15991  Returns:
15992  None.
15993  Example:
15994  <code>
15995  DRV_HANDLE handle; // Returned from DRV_USART_Open
15996  DRV_USART_Close(handle);
15997  // After this point, the handle cannot be used with any other function
15998  // except the DRV_USART_ClientStatus function, which can be used to query
15999  // the success status of the DRV_USART_Close function.
16000  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
16001  </code>
16002  Remarks:
16003  Usually there is no need for the client to verify that the Close operation
16004  has completed. The driver will abort any ongoing operations when this
16005  routine is called. However, if it requires additional time to do so in a
16006  non-blocking environment, it will still return from the Close operation but
16007  the handle is now a zombie handle. The client can only call the
16008  DRV_USART_ClientStatus on a zombie handle to track the completion of the
16009  Close operation. The DRV_USART_ClientStatus routine will return
16010  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
16011 */
16012 
16013 void
16014  DRV_USART_Close (
16015  const DRV_HANDLE handle ) ;
16016 // *****************************************************************************
16017 /*
16018  Function:
16019  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
16020  Summary:
16021  Gets the current client-specific status the USART driver.
16022  <p><b>Implementation:</b> Static/Dynamic</p>
16023  Description:
16024  This function gets the client-specific status of the USART driver associated
16025  with the given handle. This function can be used to check the status of
16026  client after the DRV_USART_Close() function has been called.
16027  Preconditions:
16028  The DRV_USART_Initialize function must have been called.
16029  DRV_USART_Open must have been called to obtain a valid opened device
16030  handle.
16031  Parameters:
16032  handle - Handle returned from the driver's open function.
16033  Returns:
16034  A DRV_USART_CLIENT_STATUS value describing the current status of the
16035  driver.
16036  Example:
16037  <code>
16038  DRV_HANDLE handle; // Returned from DRV_USART_Open
16039  DRV_USART_CLIENT_STATUS status;
16040  status = DRV_USART_ClientStatus(handle);
16041  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
16042  {
16043  // The client had not closed.
16044  }
16045  </code>
16046  Remarks:
16047  This function will not block for hardware access and will immediately return
16048  the current status. This function is thread safe when called in a RTOS
16049  application.
16050 */
16051 
16054  DRV_HANDLE handle ) ;
16055 // *****************************************************************************
16056 // *****************************************************************************
16057 // Section: USART Driver Buffer Queuing Model Interface Routines
16058 // *****************************************************************************
16059 // *****************************************************************************
16060 // *****************************************************************************
16061 /* Function:
16062  void DRV_USART_BufferAddWrite
16063  (
16064  const DRV_HANDLE handle,
16065  DRV_USART_BUFFER_HANDLE * bufferHandle,
16066  void * buffer,
16067  size_t size
16068  );
16069  Summary:
16070  Schedule a non-blocking driver write operation.
16071  <p><b>Implementation:</b> Static/Dynamic</p>
16072  Description:
16073  This function schedules a non-blocking write operation. The function returns
16074  with a valid buffer handle in the bufferHandle argument if the write request
16075  was scheduled successfully. The function adds the request to the hardware
16076  instance transmit queue and returns immediately. While the request is in the
16077  queue, the application buffer is owned by the driver and should not be
16078  modified. On returning, the bufferHandle parameter may be
16079  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16080  - if a buffer could not be allocated to the request
16081  - if the input buffer pointer is NULL
16082  - if the client opened the driver for read-only
16083  - if the buffer size is 0
16084  - if the transmit queue is full or the queue depth is insufficient
16085  If the requesting client registered an event callback with the driver, the
16086  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16087  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16088  was not processed successfully.
16089  Precondition:
16090  The DRV_USART_Initialize routine must have been called for the specified
16091  USART device instance and the DRV_USART_Status must have returned
16092  SYS_STATUS_READY.
16093  DRV_USART_Open must have been called to obtain a valid opened device handle.
16094  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16095  the DRV_USART_Open call.
16096  Parameters:
16097  handle - Handle of the communication channel as return by the
16098  DRV_USART_Open function.
16099  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16100  buffer - Data to be transmitted.
16101  size - Buffer size in bytes.
16102  Returns:
16103  The bufferHandle parameter will contain the return buffer handle. This will be
16104  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16105  Example:
16106  <code>
16107  MY_APP_OBJ myAppObj;
16108  uint8_t mybuffer[MY_BUFFER_SIZE];
16109  DRV_USART_BUFFER_HANDLE bufferHandle;
16110  // myUSARTHandle is the handle returned
16111  // by the DRV_USART_Open function.
16112  // Client registers an event handler with driver
16113  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16114  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16115  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16116  myBuffer, MY_BUFFER_SIZE);
16117  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16118  {
16119  // Error handling here
16120  }
16121  // Event is received when
16122  // the buffer is processed.
16123  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16124  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16125  {
16126  // contextHandle points to myAppObj.
16127  switch(event)
16128  {
16129  case DRV_USART_BUFFER_EVENT_COMPLETE:
16130  // This means the data was transferred.
16131  break;
16132  case DRV_USART_BUFFER_EVENT_ERROR:
16133  // Error handling here.
16134  break;
16135  default:
16136  break;
16137  }
16138  }
16139  </code>
16140  Remarks:
16141  This function is thread safe in a RTOS application. It can be called from
16142  within the USART Driver Buffer Event Handler that is registered by this
16143  client. It should not be called in the event handler associated with another
16144  USART driver instance. It should not otherwise be called directly in an ISR.
16145 */
16146 
16147 void
16149  const DRV_HANDLE handle ,
16150  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16151  void * buffer ,
16152  const size_t size ) ;
16153 // *****************************************************************************
16154 /* Function:
16155  void DRV_USART_AddressedBufferAddWrite
16156  (
16157  const DRV_HANDLE hClient,
16158  DRV_USART_BUFFER_HANDLE * bufferHandle,
16159  uint8_t address,
16160  void * source,
16161  size_t nWords
16162  );
16163  Summary:
16164  Schedule a non-blocking addressed driver write operation.
16165  <p><b>Implementation:</b> Dynamic</p>
16166  Description:
16167  This function schedules a non-blocking addressed write operation. The function returns
16168  with a valid buffer handle in the bufferHandle argument if the addressed write request
16169  was scheduled successfully. The function adds the request to the hardware
16170  instance transmit queue and returns immediately. While the request is in the
16171  queue, the application buffer is owned by the driver and should not be
16172  modified. On returning, the bufferHandle parameter may be
16173  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16174  - if a buffer could not be allocated to the request
16175  - if the input buffer pointer is NULL
16176  - if the client opened the driver for read-only
16177  - if the buffer size is 0
16178  - if the transmit queue is full or the queue depth is insufficient
16179  If the requesting client registered an event callback with the driver, the
16180  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16181  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16182  was not processed successfully.
16183  Precondition:
16184  The DRV_USART_Initialize routine must have been called for the specified
16185  USART device instance and the DRV_USART_Status must have returned
16186  SYS_STATUS_READY.
16187  DRV_USART_Open must have been called to obtain a valid opened device handle.
16188  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16189  the DRV_USART_Open call.
16190  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16191  Parameters:
16192  hClient - Handle of the communication channel as return by the
16193  DRV_USART_Open function.
16194  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16195  address - Address of the receiver client
16196  source - Data to be transmitted.
16197  size - Buffer size in 16-bit words.
16198  Returns:
16199  The bufferHandle parameter will contain the return buffer handle. This will be
16200  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16201  Example:
16202  <code>
16203  MY_APP_OBJ myAppObj;
16204  uint16_t mybuffer[MY_BUFFER_SIZE];
16205  DRV_USART_BUFFER_HANDLE bufferHandle;
16206  uint8_t clientAddress;
16207  // myUSARTHandle is the handle returned
16208  // by the DRV_USART_Open function.
16209  // Client registers an event handler with driver
16210  clientAddress = 0x60;
16211  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16212  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16213  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16214  myBuffer, MY_BUFFER_SIZE);
16215  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16216  {
16217  // Error handling here
16218  }
16219  // Event is received when
16220  // the buffer is processed.
16221  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16222  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16223  {
16224  // contextHandle points to myAppObj.
16225  switch(event)
16226  {
16227  case DRV_USART_BUFFER_EVENT_COMPLETE:
16228  // This means the data was transferred.
16229  break;
16230  case DRV_USART_BUFFER_EVENT_ERROR:
16231  // Error handling here.
16232  break;
16233  default:
16234  break;
16235  }
16236  }
16237  </code>
16238  Remarks:
16239  This function is thread safe in a RTOS application. It can be called from
16240  within the USART Driver Buffer Event Handler that is registered by this
16241  client. It should not be called in the event handler associated with another
16242  USART driver instance. It should not otherwise be called directly in an ISR.
16243  The source buffer should be a 16-bit word aligned buffer.
16244  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16245 */
16246 
16247 void
16249  const DRV_HANDLE hClient ,
16250  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16251  uint8_t address ,
16252  void * source ,
16253  size_t nWords ) ;
16254 // *****************************************************************************
16255 /* Function:
16256  void DRV_USART_BufferAddRead
16257  (
16258  const DRV_HANDLE handle,
16259  DRV_USART_BUFFER_HANDLE * bufferHandle,
16260  void * buffer,
16261  const size_t size
16262  )
16263  Summary:
16264  Schedule a non-blocking driver read operation.
16265  <p><b>Implementation:</b> Static/Dynamic</p>
16266  Description:
16267  This function schedules a non-blocking read operation. The function returns
16268  with a valid buffer handle in the bufferHandle argument if the read request
16269  was scheduled successfully. The function adds the request to the hardware
16270  instance receive queue and returns immediately. While the request is in the
16271  queue, the application buffer is owned by the driver and should not be
16272  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16273  bufferHandle argument:
16274  - if a buffer could not be allocated to the request
16275  - if the input buffer pointer is NULL
16276  - if the buffer size is 0
16277  - if the read queue size is full or queue depth is insufficient.
16278  - if the driver handle is invalid
16279  If the requesting client registered an event callback with the driver, the
16280  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16281  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16282  was not processed successfully.
16283  Precondition:
16284  The DRV_USART_Initialize routine must have been called for the specified
16285  USART device instance and the DRV_USART_Status must have returned
16286  SYS_STATUS_READY.
16287  DRV_USART_Open must have been called to obtain a valid opened device handle.
16288  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16289  the DRV_USART_Open call.
16290  Parameters:
16291  handle - Handle of the communication channel as returned by the
16292  DRV_USART_Open function.
16293  buffer - Buffer where the received data will be stored.
16294  size - Buffer size in bytes.
16295  Returns:
16296  The buffer handle is returned in the bufferHandle argument. This is
16297  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16298  Example:
16299  <code>
16300  MY_APP_OBJ myAppObj;
16301  uint8_t mybuffer[MY_BUFFER_SIZE];
16302  DRV_USART_BUFFER_HANDLE bufferHandle;
16303  // myUSARTHandle is the handle returned
16304  // by the DRV_USART_Open function.
16305  // Client registers an event handler with driver
16306  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16307  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16308  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16309  myBuffer, MY_BUFFER_SIZE);
16310  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16311  {
16312  // Error handling here
16313  }
16314  // Event is received when
16315  // the buffer is processed.
16316  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16317  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16318  {
16319  // contextHandle points to myAppObj.
16320  switch(event)
16321  {
16322  case DRV_USART_BUFFER_EVENT_COMPLETE:
16323  // This means the data was transferred.
16324  break;
16325  case DRV_USART_BUFFER_EVENT_ERROR:
16326  // Error handling here.
16327  break;
16328  default:
16329  break;
16330  }
16331  }
16332  </code>
16333  Remarks:
16334  This function is thread safe in a RTOS application. It can be called from
16335  within the USART Driver Buffer Event Handler that is registered by the
16336  client. It should not be called in the event handler associated with another
16337  USART driver instance. It should not be called directly in an ISR.
16338 */
16339 
16340 void
16342  const DRV_HANDLE handle ,
16343  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16344  void * buffer ,
16345  const size_t size ) ;
16346 // *****************************************************************************
16347 /* Function:
16348  void DRV_USART_BufferEventHandlerSet
16349  (
16350  const DRV_HANDLE handle,
16351  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16352  const uintptr_t context
16353  )
16354  Summary:
16355  Allows a client to identify a buffer event handling function for the driver
16356  to call back when queued buffer transfers have finished.
16357  <p><b>Implementation:</b> Static/Dynamic</p>
16358  Description:
16359  This function allows a client to identify a buffer event handling function
16360  for the driver to call back when queued buffer transfers have finished.
16361  When a client calls either the DRV_USART_BufferAddRead or
16362  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16363  the buffer that was added to the driver's buffer queue. The driver will
16364  pass this handle back to the client by calling "eventHandler" function when
16365  the buffer transfer has completed.
16366  The event handler should be set before the client performs any "buffer add"
16367  operations that could generate events. The event handler once set, persists
16368  until the client closes the driver or sets another event handler (which
16369  could be a "NULL" pointer to indicate no callback).
16370  Precondition:
16371  The DRV_USART_Initialize routine must have been called for the specified
16372  USART driver instance.
16373  DRV_USART_Open must have been called to obtain a valid opened device handle.
16374  Parameters:
16375  handle - A valid open-instance handle, returned from the driver's
16376  open routine
16377  eventHandler - Pointer to the event handler function.
16378  context - The value of parameter will be passed back to the client
16379  unchanged, when the eventHandler function is called. It can
16380  be used to identify any client specific data object that
16381  identifies the instance of the client module (for example,
16382  it may be a pointer to the client module's state structure).
16383  Returns:
16384  None.
16385  Example:
16386  <code>
16387  // myAppObj is an application specific state data object.
16388  MY_APP_OBJ myAppObj;
16389  uint8_t mybuffer[MY_BUFFER_SIZE];
16390  DRV_USART_BUFFER_HANDLE bufferHandle;
16391  // myUSARTHandle is the handle returned
16392  // by the DRV_USART_Open function.
16393  // Client registers an event handler with driver. This is done once
16394  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16395  (uintptr_t)&myAppObj );
16396  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16397  myBuffer, MY_BUFFER_SIZE);
16398  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16399  {
16400  // Error handling here
16401  }
16402  // Event Processing Technique. Event is received when
16403  // the buffer is processed.
16404  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16405  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16406  {
16407  // The context handle was set to an application specific
16408  // object. It is now retrievable easily in the event handler.
16409  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16410  switch(event)
16411  {
16412  case DRV_USART_BUFFER_EVENT_COMPLETE:
16413  // This means the data was transferred.
16414  break;
16415  case DRV_USART_BUFFER_EVENT_ERROR:
16416  // Error handling here.
16417  break;
16418  default:
16419  break;
16420  }
16421  }
16422  </code>
16423  Remarks:
16424  If the client does not want to be notified when the queued buffer transfer
16425  has completed, it does not need to register a callback. This function is
16426  thread safe when called in a RTOS application.
16427 */
16428 
16429 void
16431  const DRV_HANDLE handle ,
16432  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16433  const uintptr_t context ) ;
16434 // *****************************************************************************
16435 /* Function:
16436  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16437  Summary:
16438  Removes a requested buffer from the queue.
16439  <p><b>Implementation:</b> Static/Dynamic</p>
16440  Description:
16441  This function removes a specified buffer from the queue.
16442  The client can use this function to delete
16443  1. An unwated stalled buffer.
16444  2. Queued buffers on timeout.
16445  or in any other use case.
16446  Precondition:
16447  The DRV_USART_Initialize routine must have been called for the specified
16448  USART driver instance.
16449  DRV_USART_Open must have been called to obtain a valid opened device handle.
16450  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16451  must have been called and a valid buffer handle returned.
16452  Parameters:
16453  bufferhandle - Handle of the buffer to delete.
16454  Returns:
16455  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16456  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16457  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16458  queue successfully.
16459  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16460  the queue because of mutex timeout in RTOS environment.
16461  Example:
16462  <code>
16463  // myAppObj is an application specific object.
16464  MY_APP_OBJ myAppObj;
16465  uint8_t mybuffer[MY_BUFFER_SIZE];
16466  DRV_USART_BUFFER_HANDLE bufferHandle;
16467  // myUSARTHandle is the handle returned
16468  // by the DRV_USART_Open function.
16469  // Client registers an event handler with driver. This is done once
16470  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16471  (uintptr_t)&myAppObj );
16472  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16473  myBuffer, MY_BUFFER_SIZE );
16474  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16475  {
16476  // Error handling here
16477  }
16478  // Event Processing Technique. Event is received when
16479  // the buffer is processed.
16480  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16481  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16482  {
16483  switch(event)
16484  {
16485  case DRV_USART_BUFFER_EVENT_COMPLETE:
16486  // This means the data was transferred.
16487  break;
16488  case DRV_USART_BUFFER_EVENT_ERROR:
16489  // Error handling here.
16490  break;
16491  default:
16492  break;
16493  }
16494  }
16495  // Timeout function, where remove queued buffer if it still exists.
16496  void APP_TimeOut(void)
16497  {
16498  DRV_USART_BUFFER_RESULT bufferResult;
16499  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16500  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16501  {
16502  //Buffer removed succesfully from the queue
16503  }
16504  else
16505  {
16506  //Either buffer is invalid or expired.
16507  //Or not able to acquire mutex in RTOS mode.
16508  }
16509  }
16510  </code>
16511  Remarks:
16512  This function is thread safe when used in a RTOS application.
16513 */
16514 
16517  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16518 // *****************************************************************************
16519 /* Function:
16520  size_t DRV_USART_BufferCompletedBytesGet
16521  (
16522  DRV_USART_BUFFER_HANDLE bufferHandle
16523  );
16524  Summary:
16525  Returns the number of bytes that have been processed for the
16526  specified buffer.
16527  <p><b>Implementation:</b> Static/Dynamic</p>
16528  Description:
16529  This function returns number of bytes that have been processed for the
16530  specified buffer. The client can use this function, in a case where the
16531  buffer has terminated due to an error, to obtain the number of bytes that
16532  have been processed. Or in any other use case.
16533  This function can be used for non-DMA buffer transfers only. It cannot be
16534  used when the USART driver is configured to use DMA.
16535  Precondition:
16536  The DRV_USART_Initialize routine must have been called for the specified
16537  USART driver instance.
16538  DRV_USART_Open must have been called to obtain a valid opened device handle.
16539  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16540  must have been called and a valid buffer handle returned.
16541  Parameters:
16542  bufferhandle - Handle for the buffer of which the processed number of bytes
16543  to be obtained.
16544  Returns:
16545  Returns the number of bytes that have been processed for this buffer.
16546  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16547  buffer handle.
16548  Example:
16549  <code>
16550  // myAppObj is an application specific object.
16551  MY_APP_OBJ myAppObj;
16552  uint8_t mybuffer[MY_BUFFER_SIZE];
16553  DRV_USART_BUFFER_HANDLE bufferHandle;
16554  // myUSARTHandle is the handle returned
16555  // by the DRV_USART_Open function.
16556  // Client registers an event handler with driver. This is done once
16557  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16558  (uintptr_t)&myAppObj );
16559  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16560  myBuffer, MY_BUFFER_SIZE );
16561  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16562  {
16563  // Error handling here
16564  }
16565  // Event Processing Technique. Event is received when
16566  // the buffer is processed.
16567  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16568  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16569  {
16570  // The context handle was set to an application specific
16571  // object. It is now retrievable easily in the event handler.
16572  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16573  size_t processedBytes;
16574  switch(event)
16575  {
16576  case DRV_USART_BUFFER_EVENT_COMPLETE:
16577  // This means the data was transferred.
16578  break;
16579  case DRV_USART_BUFFER_EVENT_ERROR:
16580  // Error handling here.
16581  // We can find out how many bytes were processed in this
16582  // buffer before the error occurred.
16583  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16584  break;
16585  default:
16586  break;
16587  }
16588  }
16589  </code>
16590  Remarks:
16591  This function is thread safe when used in a RTOS application.
16592 */
16593 
16594 size_t
16596  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16597 // *****************************************************************************
16598 /* Function:
16599  size_t DRV_USART_BufferProcessedSizeGet
16600  (
16601  DRV_USART_BUFFER_HANDLE bufferHandle
16602  );
16603  Summary:
16604  This API will be deprecated and not recommended to use.
16605  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16606  processed for the specified buffer.
16607  Description:
16608  None.
16609  Precondition:
16610  None.
16611  Parameters:
16612  None.
16613  Returns:
16614  None.
16615  Example:
16616  None.
16617  Remarks:
16618  None.
16619 */
16620 
16621 size_t
16623  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16624 // *****************************************************************************
16625 // *****************************************************************************
16626 // Section: USART Driver File System Model Routines
16627 // *****************************************************************************
16628 // *****************************************************************************
16629 // *****************************************************************************
16630 /* Function:
16631  size_t DRV_USART_Read
16632  (
16633  const DRV_HANDLE handle,
16634  void * buffer,
16635  const size_t numbytes
16636  )
16637  Summary:
16638  Reads data from the USART.
16639  <p><b>Implementation:</b> Static/Dynamic</p>
16640  Description:
16641  This routine reads data from the USART. This function is blocking if the
16642  driver was opened by the client for blocking operation. This function will
16643  not block if the driver was opened by the client for non blocking operation.
16644  If the ioIntent parameter at the time of opening the driver was
16645  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16646  until) numbytes of bytes have been received or if an error occurred. If there
16647  are buffers queued for receiving data, these buffers will be serviced first. The
16648  function will not return until the requested number of bytes have been read.
16649  If the ioIntent parameter at the time of opening the driver was
16650  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16651  bytes that were actually read. The function will not wait until numBytes of
16652  bytes have been read. If there are buffer queued for reading data, then the
16653  function will not block and will return immediately with 0 bytes read.
16654  Precondition:
16655  The DRV_USART_Initialize routine must have been called for the specified
16656  USART driver instance.
16657  DRV_USART_Open must have been called to obtain a valid opened device handle.
16658  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16659  the DRV_USART_Open call.
16660  Parameters:
16661  handle - A valid open-instance handle, returned from the driver's
16662  open routine
16663  buffer - Buffer into which the data read from the USART instance
16664  will be placed.
16665  numbytes - Total number of bytes that need to be read from the module
16666  instance (must be equal to or less than the size of the
16667  buffer)
16668  Returns:
16669  Number of bytes actually copied into the caller's buffer. Returns
16670  DRV_USART_READ_ERROR in case of an error.
16671  Example:
16672  <code>
16673  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16674  char myBuffer[MY_BUFFER_SIZE];
16675  unsigned int count;
16676  unsigned int total;
16677  total = 0;
16678  do
16679  {
16680  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
16681  if(count == DRV_USART_READ_ERROR)
16682  {
16683  // There was an error. The DRV_USART_ErrorGet() function
16684  // can be called to find the exact error.
16685  }
16686  total += count;
16687  // Do something else...
16688  } while( total < MY_BUFFER_SIZE );
16689  </code>
16690  Remarks:
16691  This function is thread safe in a RTOS application. If the driver is
16692  configured for polled operation, this it will not support blocking operation
16693  in a bare metal (non-RTOS) application.
16694 */
16695 
16696 size_t
16697  DRV_USART_Read (
16698  const DRV_HANDLE handle ,
16699  void * buffer ,
16700  const size_t numbytes ) ;
16701 // *****************************************************************************
16702 /* Function:
16703  size_t DRV_USART_Write
16704  (
16705  const DRV_HANDLE handle,
16706  void * buffer,
16707  const size_t numbytes
16708  )
16709  Summary:
16710  Writes data to the USART.
16711  <p><b>Implementation:</b> Static/Dynamic</p>
16712  Description:
16713  This routine writes data to the USART. This function is blocking if the
16714  driver was opened by the client for blocking operation. This function will
16715  not block if the driver was opened by the client for non blocking operation.
16716  If the ioIntent parameter at the time of opening the driver was
16717  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16718  until) numbytes of bytes have been transmitted or if an error occurred. If
16719  there are buffers queued for writing, the function will wait until all the
16720  preceding buffers are completed. Ongoing buffer transmit operations will not
16721  be affected.
16722  If the ioIntent parameter at the time of opening the driver was
16723  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16724  bytes that were actually accepted for transmission. The function will not
16725  wait until numBytes of bytes have been transmitted. If there a buffers queued
16726  for transmit, the function will not wait and will return immediately with 0
16727  bytes.
16728  Precondition:
16729  The DRV_USART_Initialize routine must have been called for the specified
16730  USART driver instance.
16731  DRV_USART_Open must have been called to obtain a valid opened device handle.
16732  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16733  the DRV_USART_Open call.
16734  Parameters:
16735  handle - A valid open-instance handle, returned from the driver's
16736  open routine
16737  buffer - Buffer containing the data to written.
16738  numbytes - size of the buffer
16739  Returns:
16740  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
16741  in case of an error.
16742  Example:
16743  <code>
16744  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16745  char myBuffer[MY_BUFFER_SIZE];
16746  int count;
16747  unsigned int total;
16748  total = 0;
16749  do
16750  {
16751  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
16752  MY_BUFFER_SIZE - total);
16753  total += count;
16754  // Do something else...
16755  } while( total < MY_BUFFER_SIZE );
16756  </code>
16757  Remarks:
16758  This function is thread safe in a RTOS application. This function is thread
16759  safe in a RTOS application. If the driver is configured for polled
16760  operation, this it will not support blocking operation in a bare metal (non-RTOS)
16761  application.
16762 */
16763 
16764 size_t
16765  DRV_USART_Write (
16766  const DRV_HANDLE handle ,
16767  void * buffer ,
16768  const size_t numbytes ) ;
16769 // *****************************************************************************
16770 /* Function:
16771  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
16772  Summary:
16773  Returns the transmitter and receiver transfer status.
16774  <p><b>Implementation:</b> Static/Dynamic</p>
16775  Description:
16776  This returns the transmitter and receiver transfer status.
16777  Precondition:
16778  The DRV_USART_Initialize routine must have been called for the specified
16779  USART driver instance.
16780  DRV_USART_Open must have been called to obtain a valid opened device handle.
16781  Parameters:
16782  handle - A valid open-instance handle, returned from the driver's
16783  open routine
16784  Returns:
16785  A DRV_USART_TRANSFER_STATUS value describing the current status
16786  of the transfer.
16787  Example:
16788  <code>
16789  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16790  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
16791  {
16792  // Data has been received that can be read
16793  }
16794  </code>
16795  Remarks:
16796  The returned status may contain a value with more than one of the bits
16797  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
16798  should perform an "AND" with the bit of interest and verify if the result is
16799  non-zero (as shown in the example) to verify the desired status bit. This
16800  function is thread safe when called in a RTOS application.
16801 */
16802 
16805  const DRV_HANDLE handle ) ;
16806 // *****************************************************************************
16807 // *****************************************************************************
16808 // Section: USART Driver Byte Model Routines
16809 // *****************************************************************************
16810 // *****************************************************************************
16811 // *****************************************************************************
16812 /* Function:
16813  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
16814  Summary:
16815  Reads a byte of data from the USART.
16816  <p><b>Implementation:</b> Static/Dynamic</p>
16817  Description:
16818  This routine reads a byte of data from the USART.
16819  Precondition:
16820  The DRV_USART_Initialize routine must have been called for the specified
16821  USART driver instance.
16822  DRV_USART_Open must have been called to obtain a valid opened device handle.
16823  The transfer status should be checked to see if the receiver is not empty
16824  before calling this function.
16825  Parameters:
16826  handle - A valid open-instance handle, returned from the driver's
16827  open routine
16828  Returns:
16829  A data byte received by the driver.
16830  Example:
16831  <code>
16832  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16833  char myBuffer[MY_BUFFER_SIZE];
16834  unsigned int numBytes;
16835  numBytes = 0;
16836  do
16837  {
16838  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
16839  {
16840  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
16841  }
16842  // Do something else...
16843  } while( numBytes < MY_BUFFER_SIZE);
16844  </code>
16845  Remarks:
16846  This function is thread safe when called in a RTOS application. Note that
16847  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16848  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16849  DRV_USART_Write functions in a application. Calling the
16850  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
16851  processing of any queued buffers.
16852 */
16853 
16854 uint8_t
16856  const DRV_HANDLE handle ) ;
16857 // *****************************************************************************
16858 /* Function:
16859  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
16860  Summary:
16861  Writes a byte of data to the USART.
16862  <p><b>Implementation:</b> Static/Dynamic</p>
16863  Description:
16864  This routine writes a byte of data to the USART.
16865  Precondition:
16866  The DRV_USART_Initialize routine must have been called for the specified
16867  USART driver instance.
16868  DRV_USART_Open must have been called to obtain a valid opened device handle.
16869  The transfer status should be checked to see if transmitter is not full
16870  before calling this function.
16871  Parameters:
16872  handle - A valid open-instance handle, returned from the driver's
16873  open routine
16874  byte - Data byte to write to the USART
16875  Returns:
16876  None.
16877  Example:
16878  <code>
16879  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16880  char myBuffer[MY_BUFFER_SIZE];
16881  unsigned int numBytes;
16882  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
16883  numBytes = 0;
16884  while( numBytes < MY_BUFFER_SIZE );
16885  {
16886  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
16887  {
16888  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
16889  }
16890  // Do something else...
16891  }
16892  </code>
16893  Remarks:
16894  This function is thread safe when called in a RTOS application. Note that
16895  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16896  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16897  DRV_USART_Write functions in a application. Calling the
16898  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
16899  processing of any queued buffers.
16900 */
16901 
16902 void
16904  const DRV_HANDLE handle ,
16905  const uint8_t byte ) ;
16906 // *****************************************************************************
16907 /* Function:
16908  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
16909  Summary:
16910  Returns the size of the receive buffer.
16911  <p><b>Implementation:</b> Static/Dynamic</p>
16912  Description:
16913  This routine returns the size of the receive buffer.
16914  Precondition:
16915  The DRV_USART_Initialize routine must have been called for the specified
16916  USART driver instance.
16917  DRV_USART_Open must have been called to obtain a valid opened device handle.
16918  Parameters:
16919  handle - A valid open-instance handle, returned from the driver's
16920  open routine
16921  Returns:
16922  Size of the driver's receive buffer, in bytes.
16923  Example:
16924  <code>
16925  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16926  const uint8_t readBuffer[5];
16927  unsigned int size, numBytes = 0;
16928  unsigned int readbufferLen = sizeof(readBuffer);
16929  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
16930  // Do something based on the receiver buffer size
16931  </code>
16932  Remarks:
16933  Does not account for client queued buffers. This function is thread safe
16934  when called in a RTOS application.
16935 */
16936 
16937 unsigned int
16939  const DRV_HANDLE handle ) ;
16940 // *****************************************************************************
16941 /* Function:
16942  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
16943  Summary:
16944  Returns the size of the transmit buffer.
16945  <p><b>Implementation:</b> Static/Dynamic</p>
16946  Description:
16947  This routine returns the size of the transmit buffer and can be used by the
16948  application to determine the number of bytes to write with the
16949  DRV_USART_WriteByte function.
16950  Precondition:
16951  The DRV_USART_Initialize routine must have been called for the specified
16952  USART driver instance.
16953  DRV_USART_Open must have been called to obtain a valid opened device handle.
16954  Parameters:
16955  handle - A valid open-instance handle, returned from the driver's
16956  open routine
16957  Returns:
16958  Size of the driver's transmit buffer, in bytes.
16959  Examples:
16960  <code>
16961  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16962  const uint8_t writeBuffer[5];
16963  unsigned int size, numBytes = 0;
16964  unsigned int writeBufferLen = sizeof(writeBuffer);
16965  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
16966  // Do something based on the transmitter buffer size
16967  </code>
16968  Remarks:
16969  Does not account for client queued buffers. This function is thread safe
16970  when used in a RTOS application.
16971 */
16972 
16973 unsigned int
16975  const DRV_HANDLE handle ) ;
16976 // *****************************************************************************
16977 /* Function:
16978  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
16979  Summary:
16980  Provides the status of the driver's receive buffer.
16981  <p><b>Implementation:</b> Static/Dynamic</p>
16982  Description:
16983  This routine indicates if the driver's receiver buffer is empty. This
16984  function can be used in conjunction with the DRV_USART_Read and
16985  DRV_USART_ReadByte functions.
16986  Precondition:
16987  The DRV_USART_Initialize routine must have been called for the specified
16988  USART driver instance.
16989  DRV_USART_Open must have been called to obtain a valid opened device handle.
16990  Parameters:
16991  handle - A valid open-instance handle, returned from the driver's
16992  open routine
16993  Returns:
16994  true - if the driver's receive buffer is empty
16995  false - if the driver's receive buffer is not empty
16996  Example:
16997  <code>
16998  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16999  char myBuffer[MY_BUFFER_SIZE];
17000  unsigned int numBytes;
17001  numBytes = 0;
17002  while( numBytes < MY_BUFFER_SIZE );
17003  {
17004  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
17005  {
17006  if( numBytes < MY_BUFFER_SIZE )
17007  {
17008  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
17009  }
17010  else
17011  {
17012  break;
17013  }
17014  }
17015  // Do something else while more data is received.
17016  }
17017  </code>
17018  Remarks:
17019  Does not account for client queued buffers. This function is safe thread
17020  safe when used in a RTOS application.
17021 */
17022 
17023 bool
17025  const DRV_HANDLE handle ) ;
17026 // *****************************************************************************
17027 /* Function:
17028  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
17029  Summary:
17030  Provides the status of the driver's transmit buffer.
17031  <p><b>Implementation:</b> Static/Dynamic</p>
17032  Description:
17033  This routine identifies if the driver's transmit buffer is full or not. This
17034  function can be used in conjunction with the DRV_USART_Write and
17035  DRV_USART_WriteByte functions.
17036  Precondition:
17037  The DRV_USART_Initialize routine must have been called for the specified
17038  USART driver instance.
17039  DRV_USART_Open must have been called to obtain a valid opened device handle.
17040  Parameters:
17041  handle - A valid open-instance handle, returned from the driver's
17042  open routine
17043  Returns:
17044  true - if the transmit buffer is full
17045  false - if the transmit buffer is not full
17046  Example:
17047  <code>
17048  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17049  unsigned int numBytes;
17050  int bytesToWrite;
17051  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
17052  int writebufferLen = strlen((char *)writeBuffer);
17053  numBytes = 0;
17054  while( numBytes < writebufferLen )
17055  {
17056  if (DRV_USART_TransmitBufferisFull())
17057  {
17058  // Do something else until there is some room in the driver's Transmit buffer.
17059  }
17060  else
17061  {
17062  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
17063  }
17064  }
17065  </code>
17066  Remarks:
17067  Does not account for client queued buffers. This function is thread safe
17068  when called in a RTOS application.
17069 */
17070 
17071 bool
17073  const DRV_HANDLE handle ) ;
17074 // *****************************************************************************
17075 /* Function:
17076  void DRV_USART_ByteTransmitCallbackSet
17077  (
17078  const SYS_MODULE_INDEX index,
17079  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17080  )
17081  Summary:
17082  Registers a callback function for byte transmit event.
17083  Description:
17084  This function allows a transmit callback function to be registered with the
17085  driver. The callback function is invoked when a byte has been transmitted
17086  using DRV_USART_WriteByte () function.
17087  The callback function should be registered with the driver prior to any
17088  writes to the driver. The callback functionality is available only in the
17089  interrupt mode of operation. The driver clears the interrupt after invoking
17090  the callback function.
17091  Precondition:
17092  The DRV_USART_Initialize routine must have been called for the specified
17093  USART driver instance.
17094  Parameters:
17095  index - Identifier for the object instance to be opened
17096  eventHandler - Pointer to the event handler function.
17097  Returns:
17098  None.
17099  Example:
17100  <code>
17101  // myAppObj is an application specific state data object.
17102  MY_APP_OBJ myAppObj;
17103  uint8_t mybuffer[MY_BUFFER_SIZE];
17104  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17105  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17106  (uintptr_t)&myAppObj );
17107  // Register an event handler with driver. This is done once
17108  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17109  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17110  // Event Processing Technique. Event is received when
17111  // the byte is transmitted.
17112  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17113  {
17114  // Byte has been transmitted. Handle the event.
17115  }
17116  </code>
17117  Remarks:
17118  None
17119 */
17120 
17121 void
17123  const SYS_MODULE_INDEX index ,
17124  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17125 // *****************************************************************************
17126 /* Function:
17127  void DRV_USART_ByteReceiveCallbackSet
17128  (
17129  const SYS_MODULE_INDEX index,
17130  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17131  )
17132  Summary:
17133  Registers receive callback function for byte receive event.
17134  Description:
17135  This function allows a receive callback function to be registered with the
17136  driver. The callback function is invoked when a byte has been received. The
17137  received byte can then be read using DRV_USART_ReadByte() function.
17138  The callback function should be registered with the driver as part of the
17139  initialization. The callback functionality is available only in the
17140  interrupt mode of operation. The driver clears the interrupt after invoking
17141  the callback function.
17142  Precondition:
17143  The DRV_USART_Initialize routine must have been called for the specified
17144  USART driver instance.
17145  Parameters:
17146  index - Identifier for the object instance to be opened
17147  eventHandler - Pointer to the event handler function.
17148  Returns:
17149  None.
17150  Example:
17151  <code>
17152  // myAppObj is an application specific state data object.
17153  MY_APP_OBJ myAppObj;
17154  uint8_t mybuffer[MY_BUFFER_SIZE];
17155  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17156  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17157  (uintptr_t)&myAppObj );
17158  // Register an event handler with driver. This is done once
17159  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17160  // Event Processing Technique. Event is received when
17161  // a byte is received.
17162  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17163  {
17164  // Byte has been Received. Handle the event.
17165  // Read byte using DRV_USART_ReadByte ()
17166  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17167  // check if the receiver buffer is empty.
17168  }
17169  </code>
17170  Remarks:
17171  None
17172 */
17173 
17174 void
17176  const SYS_MODULE_INDEX index ,
17177  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17178 // *****************************************************************************
17179 /* Function:
17180  void DRV_USART_ByteErrorCallbackSet
17181  (
17182  const SYS_MODULE_INDEX index,
17183  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17184  )
17185  Summary:
17186  Registers callback to handle for byte error events.
17187  Description:
17188  This function allows a callback function to be registered with the driver
17189  to handle the error events occurring in the transmit/receive path during
17190  byte transfers.
17191  The callback function should be registered as part of the initialization.
17192  The callback functionality is available only in the interrupt mode of
17193  operation. The driver clears the interrupt after invoking the callback
17194  function.
17195  Precondition:
17196  The DRV_USART_Initialize routine must have been called for the specified
17197  USART driver instance.
17198  Parameters:
17199  index - Identifier for the object instance to be opened
17200  eventHandler - Pointer to the event handler function.
17201  Returns:
17202  None.
17203  Example:
17204  <code>
17205  // myAppObj is an application specific state data object.
17206  MY_APP_OBJ myAppObj;
17207  uint8_t mybuffer[MY_BUFFER_SIZE];
17208  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17209  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17210  (uintptr_t)&myAppObj );
17211  // Register an event handler with driver. This is done once
17212  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17213  // Event Processing Technique.
17214  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17215  {
17216  // Error has occurred. Handle the event.
17217  }
17218  </code>
17219  Remarks:
17220  None
17221 */
17222 
17223 void
17225  const SYS_MODULE_INDEX index ,
17226  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17227 // *****************************************************************************
17228 // *****************************************************************************
17229 // Section: USART Driver Setup and Status Routines
17230 // *****************************************************************************
17231 // *****************************************************************************
17232 // *****************************************************************************
17233 /* Function:
17234  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17235  Summary:
17236  This function returns the error(if any) associated with the last client
17237  request.
17238  <p><b>Implementation:</b> Static/Dynamic</p>
17239  Description:
17240  This function returns the error(if any) associated with the last client
17241  request. DRV_USART_Read and DRV_USART_Write will update the client
17242  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17243  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17244  call this function to know the error cause. The error status will be updated
17245  on every operation and should be read frequently (ideally immediately after
17246  the driver operation has completed) to know the relevant error status.
17247  Precondition:
17248  The DRV_USART_Initialize routine must have been called for the specified
17249  USART driver instance.
17250  DRV_USART_Open must have been called to obtain a valid opened device handle.
17251  Parameters:
17252  bufferhandle - Handle of the buffer of which the processed number of bytes
17253  to be obtained.
17254  Returns:
17255  A DRV_USART_ERROR type indicating last known error status.
17256  Example:
17257  <code>
17258  // myAppObj is an application specific object.
17259  MY_APP_OBJ myAppObj;
17260  uint8_t mybuffer[MY_BUFFER_SIZE];
17261  DRV_USART_BUFFER_HANDLE bufferHandle;
17262  // myUSARTHandle is the handle returned
17263  // by the DRV_USART_Open function.
17264  // Client registers an event handler with driver. This is done once.
17265  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17266  (uintptr_t)&myAppObj );
17267  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17268  myBuffer, MY_BUFFER_SIZE );
17269  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17270  {
17271  // Error handling here
17272  }
17273  // Event Processing Technique. Event is received when
17274  // the buffer is processed.
17275  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17276  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17277  {
17278  // The context handle was set to an application specific
17279  // object. It is now retrievable easily in the event handler.
17280  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17281  size_t processedBytes;
17282  switch(event)
17283  {
17284  case DRV_USART_BUFFER_EVENT_COMPLETE:
17285  // This means the data was transferred.
17286  break;
17287  case DRV_USART_BUFFER_EVENT_ERROR:
17288  // Error handling here.
17289  // We can find out how many bytes were processed in this
17290  // buffer before the error occurred. We can also find
17291  // the error cause.
17292  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17293  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17294  {
17295  // There was an receive over flow error.
17296  // Do error handling here.
17297  }
17298  break;
17299  default:
17300  break;
17301  }
17302  }
17303  </code>
17304  Remarks:
17305  It is the client's responsibility to make sure that the error status is
17306  obtained frequently. The driver will update the client error status
17307  regardless of whether this has been examined by the client. This function
17308  is thread safe when used in a RTOS application.
17309 */
17310 
17313  const DRV_HANDLE client ) ;
17314 // *****************************************************************************
17315 /* Function:
17316  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17317  Summary:
17318  This function changes the USART module baud to the specified value.
17319  <p><b>Implementation:</b> Static/Dynamic</p>
17320  Description:
17321  This function changes the USART module baud to the specified value. Any
17322  queued buffer requests will be processed at the updated baud. The USART
17323  driver operates at the baud specified in DRV_USART_Initialize function
17324  unless the DRV_USART_BaudSet function is called to change the baud.
17325  Precondition:
17326  The DRV_USART_Initialize routine must have been called for the specified
17327  USART driver instance.
17328  DRV_USART_Open must have been called to obtain a valid opened device handle.
17329  Parameters:
17330  handle - client handle returned by DRV_USART_Open function.
17331  baud - desired baud.
17332  Returns:
17333  None.
17334  Example:
17335  <code>
17336  // myUSARTHandle is the handle returned
17337  // by the DRV_USART_Open function.
17338  DRV_USART_BaudSet(myUSARTHandle, 9600);
17339  </code>
17340  Remarks:
17341  The implementation of this function, in this release of the driver, changes
17342  the baud immediately. This may interrupt on-going data transfer. It is
17343  recommended that the driver be opened exclusively if this function is to be
17344  called. This function is thread safe when used in a RTOS application.
17345 */
17346 
17349  const DRV_HANDLE client ,
17350  uint32_t baud ) ;
17351 // *****************************************************************************
17352 /* Function:
17353  void DRV_USART_LineControlSet
17354  (
17355  DRV_HANDLE client,
17356  DRV_USART_LINE_CONTROL lineControl
17357  );
17358  Summary:
17359  This function changes the USART module line control to the specified value.
17360  <p><b>Implementation:</b> Static/Dynamic</p>
17361  Description:
17362  This function changes the USART module line control parameters to the
17363  specified value. Any queued buffer requests will be processed at the
17364  updated line control parameters. The USART driver operates at the line
17365  control parameters specified in DRV_USART_Initialize function unless the
17366  DRV_USART_LineControlSet function is called to change the line control
17367  parameters.
17368  Precondition:
17369  The DRV_USART_Initialize routine must have been called for the specified
17370  USART driver instance.
17371  DRV_USART_Open must have been called to obtain a valid opened device handle.
17372  Parameters:
17373  handle - client handle returned by DRV_USART_Open function.
17374  lineControl - line control parameters.
17375  Returns:
17376  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17377  DRV_HANDLE_INVALID if the client handle is not valid.
17378  Example:
17379  <code>
17380  // myUSARTHandle is the handle returned
17381  // by the DRV_USART_Open function.
17382  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17383  </code>
17384  Remarks:
17385  The implementation of this function, in this release of the driver, changes
17386  the line control immediately. This may interrupt on-going data transfer. It
17387  is recommended that the driver be opened exclusively if this function is to
17388  be called. This function is thread safe when called in a RTOS application.
17389 */
17390 
17393  const DRV_HANDLE client ,
17394  const DRV_USART_LINE_CONTROL lineControl ) ;
17395 //DOM-IGNORE-BEGIN
17396 //DOM-IGNORE-END
17397  // #ifndef _DRV_USART_H
17398 /*******************************************************************************
17399  End of File
17400 */
17401 
17402 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17403 /* CLOSE_FILE Include File */
17404 
17405 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17406 /*******************************************************************************
17407  USART Driver Variant Mapping
17408  Company:
17409  Microchip Technology Inc.
17410  File Name:
17411  drv_usart_variant_mapping.h
17412  Summary:
17413  USART Driver Variant Mapping
17414  Description:
17415  This file provides feature and build variant mapping macros allowing the
17416  driver to easily be built with different implementation variations based
17417  on static build-time configuration selections.
17418 *******************************************************************************/
17419 //DOM-IGNORE-BEGIN
17420 /*******************************************************************************
17421 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17422 Microchip licenses to you the right to use, modify, copy and distribute
17423 Software only when embedded on a Microchip microcontroller or digital signal
17424 controller that is integrated into your product or third party product
17425 (pursuant to the sublicense terms in the accompanying license agreement).
17426 You should refer to the license agreement accompanying this Software for
17427 additional information regarding your rights and obligations.
17428 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17429 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17430 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17431 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17432 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17433 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17434 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17435 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17436 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17437 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17438 *******************************************************************************/
17439 //DOM-IGNORE-END
17440 #ifndef _DRV_USART_FEATURE_MAPPING_H
17441 #define _DRV_USART_FEATURE_MAPPING_H
17442 // *****************************************************************************
17443 // *****************************************************************************
17444 // Section: Interrrupt Variations
17445 // *****************************************************************************
17446 // *****************************************************************************
17447 /* Mapping of the interrupt mode variations
17448 */
17449  /* Driver is configured for polled mode */
17450 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17451 #define _DRV_USART_InterruptSourceEnable( source )
17452 #define _DRV_USART_InterruptSourceDisable( source ) false
17453 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17454 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17455 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17456 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17457 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17458  /* This means the driver is being built in a baremetal application.
17459  We cannot let a client open the driver in blocking mode */
17460 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17461 // *****************************************************************************
17462 // *****************************************************************************
17463 // Section: Buffer Queue support
17464 // *****************************************************************************
17465 // *****************************************************************************
17466 /* Mapping of macros for buffer queue support
17467 */
17468  /* We dont need buffer queues or byte model support */
17469 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17470 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17471 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17472 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17473 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17474 // *****************************************************************************
17475 // *****************************************************************************
17476 // Initializtion Parameter Static Overrides
17477 // *****************************************************************************
17478 // *****************************************************************************
17479  //_DRV_USART_FEATURE_MAPPING_H
17480 /*******************************************************************************
17481  End of File
17482 */
17483 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17484 /* CLOSE_FILE Include File */
17485 
17486 #include "system/clk/sys_clk.h"
17487 #include "system/int/sys_int.h"
17488 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17489 /*******************************************************************************
17490  Debug System Services Library Header
17491  Company:
17492  Microchip Technology Inc.
17493 
17494  File Name:
17495  sys_debug.h
17496  Summary:
17497  Defines the common debug definitions and interfaces used by MPLAB Harmony
17498  libraries to report errors and debug information to the user.
17499  Description:
17500  This header file defines the common debug definitions and interface macros
17501  (summary below) and prototypes used by MPLAB Harmony libraries to report
17502  errors and debug information to the user.
17503  *******************************************************************************/
17504 //DOM-IGNORE-BEGIN
17505 /*******************************************************************************
17506 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17507 Microchip licenses to you the right to use, modify, copy and distribute
17508 Software only when embedded on a Microchip microcontroller or digital signal
17509 controller that is integrated into your product or third party product
17510 (pursuant to the sublicense terms in the accompanying license agreement).
17511 You should refer to the license agreement accompanying this Software for
17512 additional information regarding your rights and obligations.
17513 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17514 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17515 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17516 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17517 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17518 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17519 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17520 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17521 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17522 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17523  *******************************************************************************/
17524 //DOM-IGNORE-END
17525 #ifndef _SYS_DEBUG_H
17526 #define _SYS_DEBUG_H
17527 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17528  /* LDRA full path */
17529 // This should be defined in system_config.h. It is added here as a build safe-guard.
17530 #define SYS_DEBUG_BUFFER_DMA_READY
17531 // *****************************************************************************
17532 // *****************************************************************************
17533 // Section: SYS DEBUG Data Types
17534 // *****************************************************************************
17535 // *****************************************************************************
17536 // *****************************************************************************
17537 /* SYS_ERROR_LEVEL enumeration
17538  Summary:
17539  System error message priority levels.
17540  Description:
17541  This enumeration defines the supported system error message priority values.
17542  Remarks:
17543  Used by debug message macros to compare individual message priority against
17544  a global system-wide error message priority level to determine if an
17545  individual message should be displayed.
17546 */
17547 
17548 typedef
17549  enum
17550  {
17551  /* Errors that have the potential to cause a system crash. */
17553  /* Errors that have the potential to cause incorrect behavior. */
17555  /* Warnings about potentially unexpected behavior or side effects. */
17557  /* Information helpful to understanding potential errors and warnings. */
17559  /* Verbose information helpful during debugging and testing. */
17561  } SYS_ERROR_LEVEL ;
17562 // DOM-IGNORE-BEGIN
17563 // *****************************************************************************
17564 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17565  SYS_DEBUG_ErrorLevelSet functions to access this value.
17566 */
17567 
17568 extern SYS_ERROR_LEVEL
17569  gblErrLvl ;
17570 // DOM-IGNORE-END
17571 // *****************************************************************************
17572 /* SYS Debug Module Index Number
17573  Summary:
17574  Debug System Service index.
17575  Description:
17576  This constant defines a symbolic name for the debug system service index.
17577  Remarks:
17578  There can only be a single debug system service instance in the system.
17579 */
17580 #define SYS_DEBUG_INDEX_0 0
17581 // *****************************************************************************
17582 /* SYS Debug Initialize structure
17583  Summary:
17584  Defines the data required to initialize the debug system service.
17585  Description:
17586  This structure defines the data required to initialize the debug system
17587  service.
17588  Remarks:
17589  None.
17590 */
17591 
17592 typedef
17593  struct
17594  {
17595  /* System module initialization */
17596  SYS_MODULE_INIT moduleInit ;
17597  /* Initial system error level setting. */
17599  /* Console index to receive debug messages */
17600  SYS_MODULE_INDEX consoleIndex ;
17601  } SYS_DEBUG_INIT ;
17602 // *****************************************************************************
17603 // *****************************************************************************
17604 // Section: SYS DEBUG Functions
17605 // *****************************************************************************
17606 // *****************************************************************************
17607 // *****************************************************************************
17608 /* Function:
17609  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17610  const SYS_MODULE_INIT * const init )
17611  Summary:
17612  Initializes the global error level and specific module instance.
17613  Description:
17614  This function initializes the global error level. It also initializes any
17615  internal system debug module data structures.
17616  Precondition:
17617  None.
17618  Parameters:
17619  index - Index for the instance to be initialized
17620  init - Pointer to a data structure containing any data necessary
17621  to initialize the debug service. This pointer may be null
17622  if no data is required because static overrides have
17623  been provided.
17624  Returns:
17625  If successful, returns a valid handle to an object. Otherwise, it
17626  returns SYS_MODULE_OBJ_INVALID.
17627  Example:
17628  <code>
17629  SYS_MODULE_OBJ objectHandle;
17630  SYS_DEBUG_INIT debugInit =
17631  {
17632  .moduleInit = {0},
17633  .errorLevel = SYS_ERROR_DEBUG,
17634  };
17635  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
17636  if (SYS_MODULE_OBJ_INVALID == objectHandle)
17637  {
17638  // Handle error
17639  }
17640  </code>
17641  Remarks:
17642  This routine should only be called once during system initialization. If the
17643  system was already initialized it safely returns without causing any disturbance.
17644 */
17645 
17646 SYS_MODULE_OBJ
17648  const SYS_MODULE_INDEX index ,
17649  const SYS_MODULE_INIT * const init ) ;
17650 // *****************************************************************************
17651 /* Function:
17652  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
17653  const SYS_MODULE_INIT * const init )
17654  Summary:
17655  Reinitializes and refreshes the data structure for the instance of the
17656  Debug module.
17657  Description:
17658  This function reinitializes and refreshes the data structure for the instance
17659  of the Debug module using the supplied data.
17660  Precondition:
17661  The SYS_DEBUG_Initialize function should have been called before calling
17662  this function.
17663  Parameters:
17664  object - Identifies the SYS DEBUG Object returned by the Initialize
17665  interface
17666  init - Pointer to the data structure containing any data
17667  necessary to initialize the hardware
17668  Returns:
17669  None
17670  Example:
17671  <code>
17672  SYS_MODULE_OBJ objectHandle;
17673  // Populate the console initialization structure
17674  SYS_DEBUG_INIT dbgInit =
17675  {
17676  .moduleInit = {0},
17677  .errorLevel = SYS_ERROR_DEBUG,
17678  };
17679  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
17680  </code>
17681  Remarks:
17682  This operation uses the same initialization data structure as the
17683  SYS_DEBUG_Initialize operation. This function can be called multiple times
17684  to reinitialize the module.
17685 */
17686 
17687 void
17689  SYS_MODULE_OBJ object ,
17690  const SYS_MODULE_INIT * const init ) ;
17691 // *****************************************************************************
17692 /* Function:
17693  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
17694  Summary:
17695  Deinitializes the specific module instance of the Debug module.
17696  Description:
17697  This function deinitializes the specific module instance disabling its
17698  operation (and any hardware for driver modules). Resets all of the internal
17699  data structures and fields for the specified instance to the default settings.
17700  Precondition:
17701  The SYS_DEBUG_Initialize function should have been called before calling
17702  this function.
17703  Parameters:
17704  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17705  Returns:
17706  None.
17707  Example:
17708  <code>
17709  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17710  SYS_DEBUG_Deinitialize (object);
17711  </code>
17712  Remarks:
17713  Once the Initialize operation has been called, the Deinitialize
17714  operation must be called before the Initialize operation can be called
17715  again.
17716 */
17717 
17718 void
17720  SYS_MODULE_OBJ object ) ;
17721 // *****************************************************************************
17722 /* Function:
17723  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
17724  Summary:
17725  Maintains the debug module's state machine.
17726  Description:
17727  This function is used to maintain the debug module's internal state
17728  machine and implement its ISR for interrupt-driven implementations.
17729  Precondition:
17730  The SYS_DEBUG_Initialize function must have been called for the specified
17731  CONSOLE driver instance.
17732  Parameters:
17733  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17734  Returns:
17735  None.
17736  Example:
17737  <code>
17738  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17739  while (true)
17740  {
17741  SYS_DEBUG_Tasks (object);
17742  // Do other tasks
17743  }
17744  </code>
17745  Remarks:
17746  This function is normally not called directly by an application. It is
17747  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
17748  ISR.
17749 */
17750 
17751 void
17752  SYS_DEBUG_Tasks (
17753  SYS_MODULE_OBJ object ) ;
17754 // *****************************************************************************
17755 /* Function:
17756  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
17757  Summary:
17758  Returns status of the specific instance of the debug service module.
17759  Description:
17760  This function returns the status of the specific debug service module
17761  instance.
17762  Precondition:
17763  The SYS_CONSOLE_Initialize function should have been called before calling
17764  this function.
17765  Parameters:
17766  object - Debug module object handle, returned from SYS_DEBUG_Initialize
17767  Returns:
17768  * SYS_STATUS_READY - Indicates that the module is running and
17769  ready to service requests. Any value greater
17770  than SYS_STATUS_READY is also a normal
17771  running state in which the module is ready
17772  to accept new operations.
17773  * SYS_STATUS_BUSY - Indicates that the module is busy with a
17774  previous system level operation and cannot
17775  start another.
17776  * SYS_STATUS_ERROR - Indicates that the module is in an error
17777  state. Any value less than SYS_STATUS_ERROR
17778  is also an error state.
17779  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
17780  initialized or has been deinitialized.
17781  Example:
17782  <code>
17783  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
17784  SYS_STATUS debugStatus;
17785  debugStatus = SYS_DEBUG_Status (object);
17786  if (SYS_STATUS_ERROR >= debugStatus)
17787  {
17788  // Handle error
17789  }
17790  </code>
17791  Remarks:
17792  None.
17793 */
17794 
17795 SYS_STATUS
17797  SYS_MODULE_OBJ object ) ;
17798 // *****************************************************************************
17799 // *****************************************************************************
17800 // Section: SYS DEBUG Console Functions
17801 // *****************************************************************************
17802 // *****************************************************************************
17803 // *****************************************************************************
17804 /* Function:
17805  SYS_DEBUG_Message( const char* message );
17806  Summary:
17807  Prints a message to the console regardless of the system error level.
17808  Description:
17809  This function prints a message to the console regardless of the system
17810  error level. It can be used as an implementation of the SYS_MESSAGE and
17811  SYS_DEBUG_MESSAGE macros.
17812  Precondition:
17813  SYS_DEBUG_Initialize must have returned a valid object handle and the
17814  SYS_DEBUG_Tasks function must be called by the system to complete the
17815  message request.
17816  Parameters:
17817  message - Pointer to a message string to be displayed.
17818  Returns:
17819  None.
17820  Example:
17821  <code>
17822  // In system_config.h:
17823 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
17824 
17825  // In source (.c) files:
17826  SYS_MESSAGE("My Message\n\r");
17827  </code>
17828  Remarks:
17829  Do not call this function directly. Call the SYS_MESSAGE or
17830  SYS_DEBUG_MESSAGE macros instead.
17831 
17832  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
17833  the messages and message function calls from the source code. To access
17834  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
17835  override the definitions of the individual macros.
17836 */
17837 
17838 void
17840  const char * message ) ;
17841 // *****************************************************************************
17842 /* Function:
17843  SYS_DEBUG_Print( const char* format, ... )
17844  Summary:
17845  Formats and prints a message with a variable number of arguments to the
17846  console regardless of the system error level.
17847  Description:
17848  This function formats and prints a message with a variable number of
17849  arguments to the console regardless of the system error level. It can be
17850  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
17851  Precondition:
17852  SYS_DEBUG_Initialize must have returned a valid object handle and the
17853  SYS_DEBUG_Tasks function must be called by the system to complete the
17854  message request.
17855  Parameters:
17856  format - Pointer to a buffer containing the format string for
17857  the message to be displayed.
17858  ... - Zero or more optional parameters to be formated as
17859  defined by the format string.
17860  Returns:
17861  None.
17862  Example:
17863  <code>
17864  // In system_config.h
17865 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
17866 
17867  // In source code
17868  int result;
17869 
17870  result = SomeOperation();
17871  if (result > MAX_VALUE)
17872  {
17873  SYS_PRINT("Result of %d exceeds max value\r\n", result);
17874  }
17875  </code>
17876  Remarks:
17877  The format string and arguments follow the printf convention.
17878 
17879  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
17880  macros instead.
17881 
17882  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
17883  messages and message function calls. To access and utilize the messages,
17884  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
17885  individual macros.
17886 */
17887 
17888 void
17889  SYS_DEBUG_Print (
17890  const char * format ,
17891  ... ) ;
17892 // *****************************************************************************
17893 /* Function:
17894  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
17895  Summary:
17896  Sets the global system error reporting level.
17897  Description:
17898  This function sets the global system error reporting level.
17899 
17900  Precondition:
17901  SYS_DEBUG_Initialize must have returned a valid object handle.
17902  Parameters:
17903  level - The desired system error level.
17904  Returns:
17905  None.
17906  Example:
17907  <code>
17908  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
17909  </code>
17910  Remarks:
17911  None.
17912 */
17913 
17914 void
17916  SYS_ERROR_LEVEL level ) ;
17917 // *****************************************************************************
17918 /* Function:
17919  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
17920  Summary:
17921  Returns the global system Error reporting level.
17922  Description:
17923  This function returns the global System Error reporting level.
17924 
17925  Precondition:
17926  SYS_DEBUG_Initialize must have returned a valid object handle.
17927  Parameters:
17928  None.
17929  Returns:
17930  The global System Error Level.
17931  Example:
17932  <code>
17933  SYS_ERROR_LEVEL level;
17934 
17935  level = SYS_DEBUG_ErrorLevelGet();
17936  </code>
17937  Remarks:
17938  None.
17939 */
17940 
17942  SYS_DEBUG_ErrorLevelGet ( void ) ;
17943 // *****************************************************************************
17944 // *****************************************************************************
17945 // Section: SYS DEBUG Macros
17946 // *****************************************************************************
17947 // *****************************************************************************
17948 // *****************************************************************************
17949 /* Macro:
17950  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
17951  Summary:
17952  Prints a debug message if the specified level is at or below the global
17953  system error level.
17954  Description:
17955  This macro prints a debug message if the specified level is at or below the
17956  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
17957  Precondition:
17958  SYS_DEBUG_Initialize must have returned a valid object handle.
17959  Parameters:
17960  level - The current error level threshold for displaying the message.
17961  message - Pointer to a buffer containing the message to be displayed.
17962  Returns:
17963  None.
17964  Example:
17965  <code>
17966  // In system_config.h
17967 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
17968 
17969  // In library source (.c) code.
17970  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
17971  </code>
17972  Remarks:
17973  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
17974 
17975  The default SYS_DEBUG_MESSAGE macro definition removes the message and
17976  function call from the source code. To access and utilize the message,
17977  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17978  SYS_DEBUG_MESSAGE macro.
17979 */
17980 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
17981 // *****************************************************************************
17982 /* Macro:
17983  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
17984  Summary:
17985  Formats and prints a debug message if the specified level is at or below the
17986  global system error level.
17987  Description:
17988  This function formats and prints a debug message if the specified level is
17989  at or below the global system error level. It can be used to implement the
17990  SYS_DEBUG_PRINT macro.
17991  Precondition:
17992  SYS_DEBUG_Initialize must have returned a valid object handle.
17993  Parameters:
17994  level - The current error level threshold for displaying the message.
17995  format - Pointer to a buffer containing the format string for
17996  the message to be displayed.
17997  ... - Zero or more optional parameters to be formated as
17998  defined by the format string.
17999  Returns:
18000  None.
18001  Example:
18002  <code>
18003  // In system_config.h
18004 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18005 
18006  // In source code
18007  int result;
18008 
18009  result = SomeOperation();
18010  if (result > MAX_VALUE)
18011  {
18012  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18013  // Take appropriate action
18014  }
18015  </code>
18016  Remarks:
18017  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
18018 
18019  The default SYS_DEBUG_PRINT macro definition removes the message and
18020  function call from the source code. To access and utilize the message,
18021  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
18022  SYS_DEBUG_PRINT macro.
18023 */
18024 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
18025 // DOM-IGNORE-BEGIN
18026 // *****************************************************************************
18027 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
18028  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
18029  (system_config.h) will map the macros below to the appropriate system
18030  console functions.
18031 */
18032 // DOM-IGNORE-END
18033 // *****************************************************************************
18034 /* Macro:
18035  SYS_MESSAGE( const char* message )
18036  Summary:
18037  Prints a message to the console regardless of the system error level.
18038  Description:
18039  This macro is used to print a message to the console regardless of the
18040  system error level. It can be mapped to any desired implementation.
18041  Precondition:
18042  If mapped to the _SYS_MESSAGE function, then the system debug service must
18043  be initialized and running.
18044  Parameters:
18045  message - Pointer to a buffer containing the message string to be
18046  displayed.
18047  Returns:
18048  None.
18049  Example:
18050  <code>
18051  // In system_config.h:
18052 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
18053 
18054  // In source (.c) files:
18055  SYS_MESSAGE("My Message\n\r");
18056  </code>
18057  Remarks:
18058  By default, this macro is defined as nothing, effectively removing all code
18059  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18060  defined in a way that maps calls to it to the desired implementation (see
18061  example, above).
18062 
18063  This macro can be mapped to the system console service (along with other
18064  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18065  configuration (system_config.h) instead of defining it individually.
18066 */
18067 #define SYS_MESSAGE( message )
18068 // *****************************************************************************
18069 /* Function:
18070  SYS_DEBUG_MESSAGE( const char* message )
18071  Summary:
18072  Prints a debug message if the system error level is defined defined at
18073  or lower than the level specified.
18074  Description:
18075  This function prints a debug message if the system error level is defined at
18076  or lower than the level specified.
18077  Precondition:
18078  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
18079  Parameters:
18080  level - The current error level threshold for displaying the message.
18081  message - Pointer to a buffer containing the message to be displayed.
18082  Returns:
18083  None.
18084  Example:
18085  <code>
18086 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
18087  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
18088  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
18089  </code>
18090  Remarks:
18091  By default, this macro is defined as nothing, effectively removing all code
18092  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18093  must be defined in a way that maps calls to it to the desired implementation
18094  (see example, above).
18095 
18096  This macro can be mapped to the system console service (along with other
18097  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18098  configuration (system_config.h) instead of defining it individually.
18099 */
18100 #define SYS_DEBUG_MESSAGE( level , message )
18101 // *****************************************************************************
18102 /* Function:
18103  SYS_PRINT(const char* format, ...);
18104  Summary:
18105  Formats and prints an error message with a variable number of arguments
18106  regardless of the system error level.
18107  Description:
18108  This function formats and prints an error message with a variable number of
18109  if the system error level is defined at or lower than the level specified.
18110  Precondition:
18111  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18112  Parameters:
18113  format - Pointer to a buffer containing the format string for
18114  the message to be displayed.
18115  ... - Zero or more optional parameters to be formated as
18116  defined by the format string.
18117  Returns:
18118  None.
18119  Example:
18120  <code>
18121  // In system_config.h
18122 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18123 
18124  // In source code
18125  int result;
18126 
18127  result = SomeOperation();
18128  if (result > MAX_VALUE)
18129  {
18130  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18131  // Take appropriate action
18132  }
18133  </code>
18134  Remarks:
18135  The format string and arguments follow the printf convention. This function
18136  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18137 
18138  By default, this macro is defined as nothing, effectively removing all code
18139  generated by calls to it. To process SYS_PRINT calls, this macro must be
18140  defined in a way that maps calls to it to the desired implementation (see
18141  example, above).
18142 
18143  This macro can be mapped to the system console service (along with other
18144  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18145  configuration (system_config.h) instead of defining it individually.
18146 */
18147 #define SYS_PRINT( fmt ,... )
18148 // *****************************************************************************
18149 /* Macro:
18150  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18151  Summary:
18152  Formats and prints an error message if the system error level is defined at
18153  or lower than the level specified.
18154  Description:
18155  This macro formats and prints an error message if the system error level
18156  is defined at or lower than the level specified.o
18157  Precondition:
18158  SYS_DEBUG_Initialize must have returned a valid object handle.
18159  Parameters:
18160  level - The current error level threshold for displaying the message.
18161  format - Pointer to a buffer containing the format string for
18162  the message to be displayed.
18163  ... - Zero or more optional parameters to be formated as
18164  defined by the format string.
18165  Returns:
18166  None.
18167  Example:
18168  <code>
18169  // In system_config.h
18170 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18171 
18172  // In source code
18173  int result;
18174 
18175  result = SomeOperation();
18176  if (result > MAX_VALUE)
18177  {
18178  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18179  // Take appropriate action
18180  }
18181  </code>
18182  Remarks:
18183  The format string and arguments follow the printf convention. This function
18184  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18185 
18186  By default, this macro is defined as nothing, effectively removing all code
18187  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18188  defined in a way that maps calls to it to the desired implementation (see
18189  example, above).
18190 
18191  This macro can be mapped to the system console service (along with other
18192  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18193  configuration (system_config.h) instead of defining it individually.
18194 */
18195 #define SYS_DEBUG_PRINT( level , fmt ,... )
18196 // *****************************************************************************
18197 /* Macro:
18198  SYS_DEBUG_BreakPoint( void )
18199  Summary:
18200  Inserts a software breakpoint instruction when building in Debug mode.
18201  Description:
18202  This macro inserts a software breakpoint instruction when building in Debug
18203  mode.
18204  Precondition:
18205  None.
18206  Parameters:
18207  None.
18208  Returns:
18209  None.
18210  Example:
18211  <code>
18212  if (myDebugTestFailed)
18213  {
18214  SYS_DEBUG_BreakPoint();
18215  }
18216  </code>
18217  Remarks:
18218  Compiles out if not built for debugging.
18219 */
18220 #define SYS_DEBUG_BreakPoint( )
18221 // *****************************************************************************
18222 // *****************************************************************************
18223 // Section: SYS DEBUG Deprecated Macros
18224 // *****************************************************************************
18225 // *****************************************************************************
18226 /* Do not use these macros for new development.
18227 */
18228 //DOM-IGNORE-BEGIN
18229 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18230 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18231 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18232 //DOM-IGNORE-END
18233  // _SYS_DEBUG_H
18234 /*******************************************************************************
18235  End of File
18236 */
18237 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18238 /* CLOSE_FILE Include File */
18239 
18240 // DOM-IGNORE-BEGIN
18241 // DOM-IGNORE-END
18242 // *****************************************************************************
18243 // *****************************************************************************
18244 // Section: Data Type Definitions
18245 // *****************************************************************************
18246 // *****************************************************************************
18247 /* USART FIFO+RX(8+1) size */
18248 #define _DRV_USART_RX_DEPTH 9
18249 // *****************************************************************************
18250 /* USART Static Driver Instance Object
18251  Summary:
18252  Object used to keep any data required for the static USART driver.
18253  Description:
18254  This object is used to keep track of any data that must be maintained to
18255  manage the USART static driver.
18256  Remarks:
18257  None.
18258 */
18259 
18260 typedef
18261  struct
18262  {
18263  /* Client specific error */
18265  } DRV_USART_OBJ ;
18266 // *****************************************************************************
18267 // *****************************************************************************
18268 // Section: Local functions.
18269 // *****************************************************************************
18270 // *****************************************************************************
18271 // DOM-IGNORE-BEGIN
18272 // DOM-IGNORE-END
18273  //#ifndef _DRV_USART_STATIC_LOCAL_H
18274 /*******************************************************************************
18275  End of File
18276 */
18277 
18278 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18279 /* CLOSE_FILE Include File */
18280 
18281 // DOM-IGNORE-BEGIN
18282 // DOM-IGNORE-END
18283 // *********************************************************************************************
18284 // *********************************************************************************************
18285 // Section: System Interface Headers for the Instance 0 of USART static driver
18286 // *********************************************************************************************
18287 // *********************************************************************************************
18288 
18289 SYS_MODULE_OBJ
18290  DRV_USART0_Initialize ( void ) ;
18291 
18292 void
18293  DRV_USART0_Deinitialize ( void ) ;
18294 
18295 SYS_STATUS
18296  DRV_USART0_Status ( void ) ;
18297 
18298 void
18299  DRV_USART0_TasksTransmit ( void ) ;
18300 
18301 void
18302  DRV_USART0_TasksReceive ( void ) ;
18303 
18304 void
18305  DRV_USART0_TasksError ( void ) ;
18306 // *********************************************************************************************
18307 // *********************************************************************************************
18308 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18309 // *********************************************************************************************
18310 // *********************************************************************************************
18311 
18312 DRV_HANDLE
18313  DRV_USART0_Open (
18314  const SYS_MODULE_INDEX index ,
18315  const DRV_IO_INTENT ioIntent ) ;
18316 
18317 void
18318  DRV_USART0_Close ( void ) ;
18319 
18321  DRV_USART0_ClientStatus ( void ) ;
18322 
18324  DRV_USART0_TransferStatus ( void ) ;
18325 
18327  DRV_USART0_ErrorGet ( void ) ;
18328 // *********************************************************************************************
18329 // *********************************************************************************************
18330 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18331 // *********************************************************************************************
18332 // *********************************************************************************************
18333 
18334 uint8_t
18335  DRV_USART0_ReadByte ( void ) ;
18336 
18337 void
18339  const uint8_t byte ) ;
18340 
18341 unsigned int
18343 
18344 unsigned int
18346 
18347 bool
18349 
18350 bool
18352 // *********************************************************************************************
18353 // *********************************************************************************************
18354 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18355 // *********************************************************************************************
18356 // *********************************************************************************************
18357 
18360  uint32_t baud ) ;
18361 
18364  DRV_USART_LINE_CONTROL lineControlMode ) ;
18365 // DOM-IGNORE-BEGIN
18366 // DOM-IGNORE-END
18367  // #ifndef _DRV_USART_STATIC_H
18368 /*******************************************************************************
18369  End of File
18370 */
18371 
18372 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18373 /* CLOSE_FILE Include File */
18374 
18375 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18376 /*******************************************************************************
18377  Ports System Service Interface Definition
18378  Company:
18379  Microchip Technology Inc.
18380  File Name:
18381  sys_ports.h
18382  Summary:
18383  Ports System Service interface definitions
18384  Description:
18385  This file contains the interface definition for the Ports system
18386  service. It provides a way to interact with the Ports subsystem to
18387  manage the timing requests supported by the system
18388 *******************************************************************************/
18389 //DOM-IGNORE-BEGIN
18390 /*******************************************************************************
18391 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18392 Microchip licenses to you the right to use, modify, copy and distribute
18393 Software only when embedded on a Microchip microcontroller or digital signal
18394 controller that is integrated into your product or third party product
18395 (pursuant to the sublicense terms in the accompanying license agreement).
18396 You should refer to the license agreement accompanying this Software for
18397 additional information regarding your rights and obligations.
18398 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18399 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18400 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18401 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18402 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18403 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18404 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18405 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18406 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18407 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18408 *******************************************************************************/
18409 //DOM-IGNORE-END
18410 #ifndef _SYS_PORTS_H
18411 #define _SYS_PORTS_H
18412 // *****************************************************************************
18413 // *****************************************************************************
18414 // Section: Included Files
18415 // *****************************************************************************
18416 // *****************************************************************************
18417 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18418 /*******************************************************************************
18419  PORTS System Service Library Interface Definition
18420  Company:
18421  Microchip Technology Inc.
18422  File Name:
18423  sys_ports_definitions.h
18424  Summary:
18425  PORTS System Service data type definitions header.
18426  Description:
18427  This file contains data type definitions header.
18428 *******************************************************************************/
18429 //DOM-IGNORE-BEGIN
18430 /*******************************************************************************
18431 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18432 Microchip licenses to you the right to use, modify, copy and distribute
18433 Software only when embedded on a Microchip microcontroller or digital signal
18434 controller that is integrated into your product or third party product
18435 (pursuant to the sublicense terms in the accompanying license agreement).
18436 You should refer to the license agreement accompanying this Software for
18437 additional information regarding your rights and obligations.
18438 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18439 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18440 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18441 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18442 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18443 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18444 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18445 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18446 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18447 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18448 *******************************************************************************/
18449 //DOM-IGNORE-END
18450 #ifndef _SYS_PORTS_DEFINITIONS_H
18451 #define _SYS_PORTS_DEFINITIONS_H
18452 // *****************************************************************************
18453 // *****************************************************************************
18454 // Section: File includes
18455 // *****************************************************************************
18456 // *****************************************************************************
18457 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18458 #include "system/common/sys_common.h"
18459 #include "system/common/sys_module.h"
18460 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18461 /*******************************************************************************
18462  Ports Peripheral Library Interface Header
18463  Company:
18464  Microchip Technology Inc.
18465  File Name:
18466  plib_ports.h
18467  Summary:
18468  Ports Peripheral Library Interface header for Ports function definitions.
18469  Description:
18470  This header file contains the function prototypes and definitions of
18471  the data types and constants that make up the interface to the Ports
18472  Peripheral Library for all families of Microchip microcontrollers. The
18473  definitions in this file are common to the Ports peripheral.
18474 *******************************************************************************/
18475 // DOM-IGNORE-BEGIN
18476 /*******************************************************************************
18477 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18478 Microchip licenses to you the right to use, modify, copy and distribute
18479 Software only when embedded on a Microchip microcontroller or digital signal
18480 controller that is integrated into your product or third party product
18481 (pursuant to the sublicense terms in the accompanying license agreement).
18482 You should refer to the license agreement accompanying this Software for
18483 additional information regarding your rights and obligations.
18484 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18485 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18486 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18487 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18488 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18489 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18490 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18491 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18492 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18493 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18494 *******************************************************************************/
18495 // DOM-IGNORE-END
18496 #ifndef _PLIB_PORTS_H
18497 #define _PLIB_PORTS_H
18498 #include <stdint.h>
18499 #include <stddef.h>
18500 // DOM-IGNORE-BEGIN
18501 // DOM-IGNORE-END
18502 // *****************************************************************************
18503 // *****************************************************************************
18504 // Section: Constants & Data Types
18505 // *****************************************************************************
18506 // *****************************************************************************
18507 // *****************************************************************************
18508 /* Ports data mask definition
18509  Summary:
18510  Data type defining the Ports data mask
18511  Description:
18512  This data type defines the Ports data mask
18513  Remarks:
18514  None.
18515 */
18516 
18517 typedef
18518 uint16_t
18520 // *****************************************************************************
18521 /* Ports data type definition
18522  Summary:
18523  Data type defining the Ports data type.
18524  Description:
18525  This data type defines the Ports data type.
18526  Remarks:
18527  None.
18528 */
18529 
18530 typedef
18531 uint32_t
18533 // *****************************************************************************
18534 // *****************************************************************************
18535 // Section: Included Files (continued at end of file)
18536 // *****************************************************************************
18537 // *****************************************************************************
18538 /* This section lists the other files that are included in this file. However,
18539  please see the end of the file for additional implementation header files
18540  that are also included.
18541 */
18542 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18543 //DOM-IGNORE-BEGIN
18544 /*******************************************************************************
18545 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18546 Microchip licenses to you the right to use, modify, copy and distribute
18547 Software only when embedded on a Microchip microcontroller or digital signal
18548 controller that is integrated into your product or third party product
18549 (pursuant to the sublicense terms in the accompanying license agreement).
18550 You should refer to the license agreement accompanying this Software for
18551 additional information regarding your rights and obligations.
18552 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18553 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18554 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18555 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18556 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18557 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18558 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18559 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18560 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18561 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18562  *******************************************************************************/
18563 //DOM-IGNORE-END
18564 #ifndef _PLIB_PORTS_PROCESSOR_H
18565 #define _PLIB_PORTS_PROCESSOR_H
18566 #error "Can't find header"
18567 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18568 /* CLOSE_FILE Include File */
18569 
18570 // *****************************************************************************
18571 // *****************************************************************************
18572 // Section: Ports Peripheral Library Interface Routines
18573 // *****************************************************************************
18574 // *****************************************************************************
18575 // *****************************************************************************
18576 /* Function:
18577  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18578  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18579  PORTS_REMAP_INPUT_PIN remapInputPin );
18580  Summary:
18581  Input function remapping.
18582  Description:
18583  This function controls the Input function remapping. It allows user to map
18584  any of the input functionality on any of the remappable input pin.
18585  This function does not perform atomic register access.
18586  Precondition:
18587  IOLOCK bit of configuration register should be clear to allow any remapping.
18588  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18589  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18590  find more information.
18591  Parameters:
18592  index - Identifier for the device instance to be configured
18593  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18594  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18595  Returns:
18596  None.
18597  Example:
18598  <code>
18599 
18600  // System Unlock
18601  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18602  // Unlock PPS registers
18603  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18604  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18605  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18606  </code>
18607  Remarks:
18608  This feature may not be available on all devices. Please refer to the
18609  specific device data sheet to determine availability or use
18610  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18611  this feature is available.
18612 */
18613 
18614 void
18616  PORTS_MODULE_ID index ,
18617  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18618  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18619 // *****************************************************************************
18620 /* Function:
18621  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18622  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18623  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18624  Summary:
18625  Output function remapping.
18626  Description:
18627  This function controls the Output function remapping. it allows user to map
18628  any of the output functionality on any of the remappable output pin.
18629  This function does not perform atomic register access.
18630  Precondition:
18631  IOLOCK bit of configuration register should be clear to allow any remapping.
18632  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18633  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18634  find more information.
18635  Parameters:
18636  index - Identifier for the device instance to be configured
18637  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
18638  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
18639  Returns:
18640  None.
18641  Example:
18642  <code>
18643 
18644  // System Unlock
18645  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18646  // Unlock PPS registers
18647  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18648  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
18649  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
18650 
18651  </code>
18652  Remarks:
18653  This feature may not be available on all devices. Please refer to the
18654  specific device data sheet to determine availability or use
18655  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18656  this feature is available.
18657 */
18658 
18659 void
18661  PORTS_MODULE_ID index ,
18662  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
18663  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
18664 // *****************************************************************************
18665 /* Function:
18666  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
18667  PORTS_ANALOG_PIN pin,
18668  PORTS_PIN_MODE mode );
18669  Summary:
18670  Enables the selected pin as analog or digital.
18671  Description:
18672  This function enables the selected pin as analog or digital.
18673  This function does not perform atomic register access.
18674  Precondition:
18675  None.
18676  Parameters:
18677  index - Identifier for the device instance to be configured
18678  pin - Possible values of PORTS_ANALOG_PIN
18679  mode - Possible values of PORTS_PIN_MODE
18680  Returns:
18681  None.
18682  Example:
18683  <code>
18684 
18685  // Make AN0 pin as Analog
18686  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
18687 
18688  </code>
18689  Remarks:
18690  This feature may not be available on all devices. Please refer to the
18691  specific device data sheet to determine availability or use
18692  PLIB_PORTS_ExistsPinMode in your application to determine whether
18693  this feature is available.
18694 */
18695 
18696 void
18698  PORTS_MODULE_ID index ,
18699  PORTS_ANALOG_PIN pin ,
18700  PORTS_PIN_MODE mode ) ;
18701 // *****************************************************************************
18702 /* Function:
18703  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
18704  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
18705  PORTS_PIN_MODE mode );
18706  Summary:
18707  Enables the selected port pin as analog or digital.
18708  Description:
18709  This function enables the selected port pin as analog or digital.
18710  This function does not perform atomic register access.
18711  Precondition:
18712  None.
18713  Parameters:
18714  index - Identifier for the device instance to be configured
18715  channel - Port pin channel
18716  bitPos - Position in the PORT pins
18717  mode - Possible values of PORTS_PIN_MODE
18718  Returns:
18719  None.
18720  Example:
18721  <code>
18722 
18723  // Make RC5 pin Analog
18724  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
18725  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
18726 
18727  </code>
18728  Remarks:
18729  This function is only available in devices with PPS. For Non-PPS devices, use the
18730  PLIB_PORTS_PinModeSelect function.
18731 
18732  This feature may not be available on all devices. Please refer to the
18733  specific device data sheet to determine availability or use
18734  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
18735  this feature is available.
18736 */
18737 
18738 void
18740  PORTS_MODULE_ID index ,
18741  PORTS_CHANNEL channel ,
18742  PORTS_BIT_POS bitPos ,
18743  PORTS_PIN_MODE mode ) ;
18744 // *****************************************************************************
18745 /* Function:
18746  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
18747  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18748  Summary:
18749  Enables the pull-down for selected Change Notice pins.
18750  Description:
18751  This function enables the pull-down for selected Change Notice pins.
18752  This function does not perform atomic register access.
18753  Precondition:
18754  None.
18755  Parameters:
18756  index - Identifier for the device instance to be configured
18757  channel - Port pin channel
18758  bitPos - Position in the PORT pins
18759  Returns:
18760  None.
18761  Example:
18762  <code>
18763 
18764  // Enable pull-down for RC5 pin
18765  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18766  PORTS_BIT_POS_5);
18767 
18768  </code>
18769  Remarks:
18770  This feature may not be available on all devices. Please refer to the
18771  specific device data sheet to determine availability or use
18772  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18773  determine whether this feature is available.
18774 */
18775 
18776 void
18778  PORTS_MODULE_ID index ,
18779  PORTS_CHANNEL channel ,
18780  PORTS_BIT_POS bitPos ) ;
18781 // *****************************************************************************
18782 /* Function:
18783  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
18784  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18785  Summary:
18786  Disables the pull-down for selected Change Notice pins.
18787  Description:
18788  This function disables the pull-down for selected Change Notice pins.
18789  This function does not perform atomic register access.
18790  Precondition:
18791  None.
18792  Parameters:
18793  index - Identifier for the device instance to be configured
18794  channel - Port pin channel
18795  bitPos - Position in the PORT pins
18796  Returns:
18797  None.
18798  Example:
18799  <code>
18800 
18801  // Disable pull-down for RC5 pin
18802  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18803  PORTS_BIT_POS_5);
18804  </code>
18805  Remarks:
18806  This feature may not be available on all devices. Please refer to the
18807  specific device data sheet to determine availability or use
18808  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18809  determine whether this feature is available.
18810 */
18811 
18812 void
18814  PORTS_MODULE_ID index ,
18815  PORTS_CHANNEL channel ,
18816  PORTS_BIT_POS bitPos ) ;
18817 // *****************************************************************************
18818 /* Function:
18819  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
18820  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18821  Summary:
18822  Enables the pull-up for selected Change Notice pins.
18823  Description:
18824  This function enables the pull-up for selected Change Notice pins.
18825  This function does not perform atomic register access.
18826  Precondition:
18827  None.
18828  Parameters:
18829  index - Identifier for the device instance to be configured
18830  channel - Port pin channel
18831  bitPos - Position in the PORT pins
18832  Returns:
18833  None.
18834  Example:
18835  <code>
18836 
18837  // Enable pull-up for RC5 pin
18838  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18839  PORTS_BIT_POS_5);
18840  </code>
18841  Remarks:
18842  This function is only available in devices with PPS. For Non-PPS devices, use the
18843  PLIB_PORTS_ChangeNoticePullUpEnable function.
18844 
18845  This feature may not be available on all devices. Please refer to the
18846  specific device data sheet to determine availability or use
18847  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18848  determine whether this feature is available.
18849 */
18850 
18851 void
18853  PORTS_MODULE_ID index ,
18854  PORTS_CHANNEL channel ,
18855  PORTS_BIT_POS bitPos ) ;
18856 // *****************************************************************************
18857 /* Function:
18858  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
18859  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
18860  Summary:
18861  Disables weak pull-up for the selected pin.
18862  Description:
18863  This function disables weak pull-up for the selected port pin.
18864  This function does not perform atomic register access.
18865  Precondition:
18866  None.
18867  Parameters:
18868  index - Identifier for the device instance to be configured
18869  channel - Port pin channel
18870  bitPos - Position in the PORT pins
18871  Returns:
18872  None.
18873  Example:
18874  <code>
18875 
18876  // Disable pull-up for RC5 pin
18877  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18878  PORTS_BIT_POS_5);
18879 
18880  </code>
18881  Remarks:
18882  This function is only available in devices with PPS. For Non-PPS devices, use the
18883  PLIB_PORTS_ChangeNoticePullUpDisable function.
18884 
18885  Pull-ups on change notification pins should always be disabled when the
18886  port pin is configured as a digital output.
18887 
18888  This feature may not be available on all devices. Please refer to the
18889  specific device data sheet to determine availability or use
18890  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18891  determine whether this feature is available.
18892 */
18893 
18894 void
18896  PORTS_MODULE_ID index ,
18897  PORTS_CHANNEL channel ,
18898  PORTS_BIT_POS bitPos ) ;
18899 // *****************************************************************************
18900 /* Function:
18901  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
18902  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18903  Summary:
18904  Enables CN interrupt for the selected pin.
18905  Description:
18906  This function enables Change Notice interrupt for the selected port pin.
18907  This function does not perform atomic register access.
18908 
18909  Precondition:
18910  None.
18911  Parameters:
18912  index - Identifier for the device instance to be configured
18913  channel - Port pin channel
18914  bitPos - Position in the PORT pins
18915  Returns:
18916  None.
18917  Example:
18918  <code>
18919 
18920  // Enable CN interrupt for RC5 pin
18921  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18922  PORTS_BIT_POS_5);
18923 
18924  </code>
18925  Remarks:
18926  This function is only available in devices with PPS. For Non-PPS devices, use the
18927  PLIB_PORTS_PinChangeNoticeEnable function.
18928 
18929  This feature may not be available on all devices. Please refer to the
18930  specific device data sheet to determine availability or use
18931  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18932  determine whether this feature is available.
18933 */
18934 
18935 void
18937  PORTS_MODULE_ID index ,
18938  PORTS_CHANNEL channel ,
18939  PORTS_BIT_POS bitPos ) ;
18940 // *****************************************************************************
18941 /* Function:
18942  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
18943  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18944  Summary:
18945  Disables CN interrupt for the selected pin.
18946  Description:
18947  This function disables Change Notice interrupt for the selected port pin.
18948  This function does not perform atomic register access.
18949  Precondition:
18950  None.
18951  Parameters:
18952  index - Identifier for the device instance to be configured
18953  channel - Port pin channel
18954  bitPos - Position in the PORT pins
18955  Returns:
18956  None.
18957  Example:
18958  <code>
18959 
18960  // Disable CN interrupt for RC5 pin
18961  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18962  PORTS_BIT_POS_5);
18963 
18964  </code>
18965  Remarks:
18966  This function is only available in devices with PPS. For Non-PPS devices, use the
18967  PLIB_PORTS_PinChangeNoticeDisable function.
18968 
18969  This feature may not be available on all devices. Please refer to the
18970  specific device data sheet to determine availability or use
18971  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18972  determine whether this feature is available.
18973 */
18974 
18975 void
18977  PORTS_MODULE_ID index ,
18978  PORTS_CHANNEL channel ,
18979  PORTS_BIT_POS bitPos ) ;
18980 // *****************************************************************************
18981 /* Function:
18982  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
18983  PORTS_CHANNEL channel );
18984  Summary:
18985  Enables the change notification for selected port.
18986  Description:
18987  This function enables the change notification for selected port.
18988  This function does not perform atomic register access.
18989  Precondition:
18990  None.
18991  Parameters:
18992  index - Identifier for the device instance to be configured
18993  channel - Port pin channel
18994  Returns:
18995  None.
18996  Example:
18997  <code>
18998  // Enable Change notification for Port C
18999  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
19000 
19001  </code>
19002  Remarks:
19003  This function is only available in devices with PPS. For Non-PPS devices, use the
19004  PLIB_PORTS_ChangeNoticeEnable function.
19005 
19006  This feature may not be available on all devices. Please refer to the
19007  specific device data sheet to determine availability or use
19008  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
19009  whether this feature is available.
19010 */
19011 
19012 void
19014  PORTS_MODULE_ID index ,
19015  PORTS_CHANNEL channel ) ;
19016 // *****************************************************************************
19017 /* Function:
19018  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
19019  PORTS_CHANNEL channel );
19020  Summary:
19021  Disables the change notification for selected port.
19022  Description:
19023  This function disables the change notification for selected port.
19024  This function does not perform atomic register access.
19025  Precondition:
19026  None.
19027  Parameters:
19028  index - Identifier for the device instance to be configured
19029  channel - Port pin channel
19030  Returns:
19031  None.
19032  Example:
19033  <code>
19034  // Disable Change notification for Port C
19035  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
19036 
19037  </code>
19038  Remarks:
19039  This function is only available in devices with PPS. For Non-PPS devices, use the
19040  PLIB_PORTS_ChangeNoticeDisable function.
19041 
19042  This feature may not be available on all devices. Please refer to the
19043  specific device data sheet to determine availability or use
19044  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
19045  whether this feature is available.
19046 */
19047 
19048 void
19050  PORTS_MODULE_ID index ,
19051  PORTS_CHANNEL channel ) ;
19052 // *****************************************************************************
19053 /* Function:
19054  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
19055  PORTS_CHANNEL channel );
19056  Summary:
19057  Allows CN to be working in Idle mode for selected channel.
19058  Description:
19059  This function makes sure that change notification feature keeps working in
19060  Idle mode for the selected channel.
19061  This function does not perform atomic register access.
19062  Precondition:
19063  None.
19064  Parameters:
19065  index - Identifier for the device instance to be configured
19066  channel - Port pin channel
19067  Returns:
19068  None.
19069  Example:
19070  <code>
19071 
19072  // Change notification continues working in Idle mode for Port C
19073  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
19074 
19075  </code>
19076  Remarks:
19077  This function is only available in devices with PPS. For Non-PPS devices, use the
19078  PLIB_PORTS_ChangeNoticeInIdleEnable function.
19079 
19080  This feature may not be available on all devices. Please refer to the
19081  specific device data sheet to determine availability or use
19082  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19083  whether this feature is available.
19084 */
19085 
19086 void
19088  PORTS_MODULE_ID index ,
19089  PORTS_CHANNEL channel ) ;
19090 // *****************************************************************************
19091 /* Function:
19092  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19093  PORTS_CHANNEL channel );
19094  Summary:
19095  Change Notification halts in Idle mode for selected channel.
19096  Description:
19097  This function makes sure that change notification feature halts in
19098  Idle mode for the selected channel.
19099  This function does not perform atomic register access.
19100  Precondition:
19101  None.
19102  Parameters:
19103  index - Identifier for the device instance to be configured
19104  channel - Port pin channel
19105  Returns:
19106  None.
19107  Example:
19108  <code>
19109 
19110  // Change notification halts in Idle mode for Port C
19111  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19112 
19113  </code>
19114  Remarks:
19115  This function is only available in devices with PPS. For Non-PPS devices, use the
19116  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19117 
19118  This feature may not be available on all devices. Please refer to the
19119  specific device data sheet to determine availability or use
19120  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19121  whether this feature is available.
19122 */
19123 
19124 void
19126  PORTS_MODULE_ID index ,
19127  PORTS_CHANNEL channel ) ;
19128 // *****************************************************************************
19129 /* Function:
19130  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19131  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19132  Summary:
19133  checks the status of change on the pin
19134  Description:
19135  This function checks if the change has occurred on the given pin or not.
19136  This function does not perform atomic register access.
19137  Precondition:
19138  None.
19139  Parameters:
19140  index - Identifier for the device instance to be configured
19141  channel - Port pin channel
19142  bitPos - Position in the PORT pins
19143  Returns:
19144  None.
19145  Example:
19146  <code>
19147 
19148  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19149  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19150  {
19151  //do something
19152  }
19153 
19154  </code>
19155  Remarks:
19156  This feature may not be available on all devices. Please refer to the
19157  specific device data sheet to determine availability or use
19158  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19159  whether this feature is available.
19160 */
19161 
19162 bool
19164  PORTS_MODULE_ID index ,
19165  PORTS_CHANNEL channel ,
19166  PORTS_BIT_POS bitPos ) ;
19167 // *****************************************************************************
19168 /* Function:
19169  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19170  PORTS_BIT_POS bitPos )
19171  Summary:
19172  Reads/Gets data from the selected digital pin.
19173  Description:
19174  This function reads/gets data from the selected digital PORT i/o pin.
19175  This function should be used to read the live data at the pin.
19176  This function does not perform atomic register access.
19177 
19178  Precondition:
19179  None.
19180  Parameters:
19181  index - Identifier for the device instance to be configured
19182  channel - Identifier for the Ports channel A, B, C, etc.
19183  bitPos - Possible values of PORTS_BIT_POS
19184  Returns:
19185  Port pin read data.
19186  Example:
19187  <code>
19188  // read port pin RC4
19189  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19190  PORTS_BIT_POS_4);
19191  </code>
19192  Remarks:
19193  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19194 
19195  This feature may not be available on all devices. Please refer to the
19196  specific device data sheet to determine availability or use
19197  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19198  this feature is available.
19199 */
19200 
19201 bool
19203  PORTS_MODULE_ID index ,
19204  PORTS_CHANNEL channel ,
19205  PORTS_BIT_POS bitPos ) ;
19206 // *****************************************************************************
19207 /* Function:
19208  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19209  PORTS_BIT_POS bitPos )
19210  Summary:
19211  Reads/Gets data from the selected latch.
19212  Description:
19213  This function reads/gets data from the selected PORTx Data Latch, not from
19214  the port I/O pins.
19215  This function does not perform atomic register access.
19216 
19217  Precondition:
19218  None.
19219  Parameters:
19220  index - Identifier for the device instance to be configured
19221  channel - Identifier for the Ports channel A, B, C, etc.
19222  bitPos - Possible values of PORTS_BIT_POS
19223  Returns:
19224  Latch read data.
19225  Example:
19226  <code>
19227  // read latch RC4
19228  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19229  PORTS_BIT_POS_4);
19230  </code>
19231  Remarks:
19232  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19233  should be used.
19234 
19235  This feature may not be available on all devices. Please refer to the
19236  specific device data sheet to determine availability or use
19237  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19238  this feature is available.
19239 */
19240 
19241 bool
19243  PORTS_MODULE_ID index ,
19244  PORTS_CHANNEL channel ,
19245  PORTS_BIT_POS bitPos ) ;
19246 // *****************************************************************************
19247 /* Function:
19248  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19249  PORTS_BIT_POS bitPos,
19250  bool value )
19251  Summary:
19252  Writes the selected digital pin/latch.
19253  Description:
19254  This function writes to the selected digital pin/latch.
19255  This function does not perform atomic register access.
19256  Precondition:
19257  None.
19258  Parameters:
19259  index - Identifier for the device instance to be configured
19260  channel - Identifier for the Ports channel A, B, C, etc.
19261  bitPos - Possible values of PORTS_BIT_POS
19262  value - Value to be written to the specific pin/latch
19263  true - sets the bit, false - clears the bit
19264  Returns:
19265  None.
19266  Example:
19267  <code>
19268 
19269  // write 'one' in port RC4
19270  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19271 
19272  </code>
19273  Remarks:
19274  This feature may not be available on all devices. Please refer to the
19275  specific device data sheet to determine availability or use
19276  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19277  this feature is available.
19278 */
19279 
19280 void
19282  PORTS_MODULE_ID index ,
19283  PORTS_CHANNEL channel ,
19284  PORTS_BIT_POS bitPos ,
19285  bool value ) ;
19286 // *****************************************************************************
19287 /* Function:
19288  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19289  PORTS_BIT_POS bitPos )
19290  Summary:
19291  Sets the selected digital pin/latch.
19292  Description:
19293  This function sets the selected digital pin/latch.
19294  This function does not perform atomic register access.
19295  Precondition:
19296  None.
19297  Parameters:
19298  index - Identifier for the device instance to be configured
19299  channel - Identifier for the Ports channel A, B, C, etc.
19300  bitPos - Possible values of PORTS_BIT_POS
19301  Returns:
19302  None.
19303  Example:
19304  <code>
19305 
19306  // Sets port pin RC4
19307  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19308 
19309  </code>
19310  Remarks:
19311  This feature may not be available on all devices. Please refer to the
19312  specific device data sheet to determine availability or use
19313  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19314  this feature is available.
19315 */
19316 
19317 void
19319  PORTS_MODULE_ID index ,
19320  PORTS_CHANNEL channel ,
19321  PORTS_BIT_POS bitPos ) ;
19322 // *****************************************************************************
19323 /* Function:
19324  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19325  PORTS_BIT_POS bitPos )
19326  Summary:
19327  Clears the selected digital pin/latch.
19328  Description:
19329  This function clears the selected digital pin/latch.
19330  This function does not perform atomic register access.
19331  Precondition:
19332  None.
19333  Parameters:
19334  index - Identifier for the device instance to be configured
19335  channel - Identifier for the Ports channel A, B, C, etc.
19336  bitPos - Possible values of PORTS_BIT_POS
19337  Returns:
19338  None.
19339  Example:
19340  <code>
19341 
19342  // Clears port pin RC4
19343  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19344 
19345  </code>
19346  Remarks:
19347  This feature may not be available on all devices. Please refer to the
19348  specific device data sheet to determine availability or use
19349  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19350  this feature is available.
19351 */
19352 
19353 void
19355  PORTS_MODULE_ID index ,
19356  PORTS_CHANNEL channel ,
19357  PORTS_BIT_POS bitPos ) ;
19358 // *****************************************************************************
19359 /* Function:
19360  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19361  PORTS_BIT_POS bitPos )
19362  Summary:
19363  Toggles the selected digital pin/latch.
19364  Description:
19365  This function toggles the selected digital pin/latch.
19366  This function does not perform atomic register access.
19367  Precondition:
19368  None.
19369  Parameters:
19370  index - Identifier for the device instance to be configured
19371  channel - Identifier for the Ports channel A, B, C, etc.
19372  bitPos - Possible values of PORTS_BIT_POS
19373  Returns:
19374  None.
19375  Example:
19376  <code>
19377 
19378  // Toggles port pin RC4
19379  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19380 
19381  </code>
19382  Remarks:
19383  This feature may not be available on all devices. Please refer to the
19384  specific device data sheet to determine availability or use
19385  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19386  this feature is available.
19387 */
19388 
19389 void
19391  PORTS_MODULE_ID index ,
19392  PORTS_CHANNEL channel ,
19393  PORTS_BIT_POS bitPos ) ;
19394 // *****************************************************************************
19395 /* Function:
19396  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19397  PORTS_BIT_POS bitPos )
19398  Summary:
19399  Makes the selected pin direction input
19400  Description:
19401  This function makes the selected pin direction as input
19402  This function does not perform atomic register access.
19403  Precondition:
19404  None.
19405  Parameters:
19406  index - Identifier for the device instance to be configured
19407  channel - Identifier for the Ports channel A, B, C, etc.
19408  bitPos - Possible values of PORTS_BIT_POS direction that has to
19409  be made input
19410  Returns:
19411  None.
19412  Example:
19413  <code>
19414 
19415  // make pin RC4 as input
19416  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19417 
19418  </code>
19419  Remarks:
19420  This feature may not be available on all devices. Please refer to the
19421  specific device data sheet to determine availability or use
19422  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19423  this feature is available.
19424 */
19425 
19426 void
19428  PORTS_MODULE_ID index ,
19429  PORTS_CHANNEL channel ,
19430  PORTS_BIT_POS bitPos ) ;
19431 // *****************************************************************************
19432 /* Function:
19433  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19434  PORTS_BIT_POS bitPos )
19435  Summary:
19436  Makes the selected pin direction output
19437  Description:
19438  This function makes the selected pin direction as output
19439  This function does not perform atomic register access.
19440  Precondition:
19441  None.
19442  Parameters:
19443  index - Identifier for the device instance to be configured
19444  channel - Identifier for the Ports channel A, B, C, etc.
19445  bitPos - Possible values of PORTS_BIT_POS direction that has to
19446  be made output
19447  Returns:
19448  None.
19449  Example:
19450  <code>
19451 
19452  // make pin RC4 as output
19453  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19454 
19455  </code>
19456  Remarks:
19457  This feature may not be available on all devices. Please refer to the
19458  specific device data sheet to determine availability or use
19459  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19460  this feature is available.
19461 */
19462 
19463 void
19465  PORTS_MODULE_ID index ,
19466  PORTS_CHANNEL channel ,
19467  PORTS_BIT_POS bitPos ) ;
19468 // *****************************************************************************
19469 /* Function:
19470  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19471  PORTS_BIT_POS bitPos )
19472  Summary:
19473  Enables the open drain functionality for the selected pin.
19474  Description:
19475  This function enables the open drain functionality for the selected pin.
19476  This function does not perform atomic register access.
19477  Precondition:
19478  None.
19479  Parameters:
19480  index - Identifier for the device instance to be configured
19481  channel - Identifier for the Ports channel A, B, C, etc.
19482  bitPos - Possible values of PORTS_BIT_POS
19483  Returns:
19484  None.
19485  Example:
19486  <code>
19487 
19488  // Enable open drain for pin RC4
19489  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19490 
19491  </code>
19492  Remarks:
19493  This feature may not be available on all devices. Please refer to the
19494  specific device data sheet to determine availability or use
19495  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19496  this feature is available.
19497 */
19498 
19499 void
19501  PORTS_MODULE_ID index ,
19502  PORTS_CHANNEL channel ,
19503  PORTS_BIT_POS bitPos ) ;
19504 // *****************************************************************************
19505 /* Function:
19506  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19507  PORTS_BIT_POS bitPos )
19508  Summary:
19509  Disables the open drain functionality for the selected pin.
19510  Description:
19511  This function disables the open drain functionality for the selected pin.
19512  This function does not perform atomic register access.
19513  Precondition:
19514  None.
19515  Parameters:
19516  index - Identifier for the device instance to be configured
19517  channel - Identifier for the Ports channel A, B, C, etc.
19518  bitPos - One of the possible values of PORTS_BIT_POS.
19519  Returns:
19520  None.
19521  Example:
19522  <code>
19523 
19524  // Disable open drain for pin RC4
19525  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19526 
19527  </code>
19528  Remarks:
19529  This feature may not be available on all devices. Please refer to the
19530  specific device data sheet to determine availability or use
19531  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19532  this feature is available.
19533 */
19534 
19535 void
19537  PORTS_MODULE_ID index ,
19538  PORTS_CHANNEL channel ,
19539  PORTS_BIT_POS bitPos ) ;
19540 // *****************************************************************************
19541 /* Function:
19542  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19543  (
19544  PORTS_MODULE_ID index,
19545  PORTS_CHANNEL channel
19546  )
19547  Summary:
19548  Reads and returns data from the selected Latch.
19549  Description:
19550  This function reads and returns the data from the selected Latch.
19551  This function does not perform atomic register access.
19552 
19553  Precondition:
19554  None.
19555  Parameters:
19556  index - Identifier for the device instance to be configured
19557  channel - Identifier for the Ports channel A, B, C, etc.
19558  Returns:
19559  Latch read data.
19560  Example:
19561  <code>
19562  // Read latch C
19563  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19564 
19565  </code>
19566  Remarks:
19567  For reading the Live data, PLIB_PORTS_Read function should be used.
19568 
19569  This feature may not be available on all devices. Please refer to the
19570  specific device data sheet to determine availability or use
19571  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19572  this feature is available.
19573 */
19574 
19577  PORTS_MODULE_ID index ,
19578  PORTS_CHANNEL channel ) ;
19579 // *****************************************************************************
19580 /* Function:
19581  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19582  Summary:
19583  Reads the selected digital port.
19584  Description:
19585  This function reads from the selected digital port.
19586  This function does not perform atomic register access.
19587  Precondition:
19588  None.
19589  Parameters:
19590  index - Identifier for the device instance to be configured
19591  channel - Identifier for the Ports channel A, B, C, etc.
19592  Returns:
19593  data on a port with width PORTS_DATA_TYPE
19594  Example:
19595  <code>
19596 
19597  // Read PORT C
19598  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19599 
19600  </code>
19601  Remarks:
19602  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19603 
19604  This feature may not be available on all devices. Please refer to the
19605  specific device data sheet to determine availability or use
19606  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19607  this feature is available.
19608 */
19609 
19611  PLIB_PORTS_Read (
19612  PORTS_MODULE_ID index ,
19613  PORTS_CHANNEL channel ) ;
19614 // *****************************************************************************
19615 /* Function:
19616  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19617  PORTS_DATA_TYPE value )
19618  Summary:
19619  Writes the selected digital port/latch.
19620  Description:
19621  This function writes to the selected digital port/latch.
19622  This function does not perform atomic register access.
19623  Precondition:
19624  None.
19625  Parameters:
19626  index - Identifier for the device instance to be configured
19627  channel - Identifier for the Ports channel A, B, C, etc.
19628  value - Value to be written into a port of width PORTS_DATA_TYPE
19629  Returns:
19630  None.
19631  Example:
19632  <code>
19633 
19634  // Write 0x12 into PORT C
19635  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
19636 
19637  </code>
19638  Remarks:
19639  This feature may not be available on all devices. Please refer to the
19640  specific device data sheet to determine availability or use
19641  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19642  this feature is available.
19643 */
19644 
19645 void
19647  PORTS_MODULE_ID index ,
19648  PORTS_CHANNEL channel ,
19649  PORTS_DATA_TYPE value ) ;
19650 // *****************************************************************************
19651 /* Function:
19652  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19653  PORTS_DATA_TYPE value,
19654  PORTS_DATA_MASK mask )
19655  Summary:
19656  Sets the selected bits of the port.
19657  Description:
19658  This function performs an 'AND' operation on the value and mask parameters,
19659  and then sets the bits in the port channel that were set by the result of the
19660  'AND' operation.
19661  This function does not perform atomic register access.
19662  Precondition:
19663  None.
19664  Parameters:
19665  index - Identifier for the device instance to be configured
19666  channel - Identifier for the Ports channel A, B, C, etc.
19667  value - Consists of information about which port bit has to be
19668  set and which not
19669  mask - Identifies the bits which could be intended for setting
19670  Returns:
19671  None.
19672  Example:
19673  <code>
19674 
19675  // MY_VALUE - 0x1234
19676  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
19677 
19678  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
19679  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
19680 
19681  </code>
19682  Remarks:
19683  This feature may not be available on all devices. Please refer to the
19684  specific device data sheet to determine availability or use
19685  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19686  this feature is available.
19687 */
19688 
19689 void
19690  PLIB_PORTS_Set (
19691  PORTS_MODULE_ID index ,
19692  PORTS_CHANNEL channel ,
19693  PORTS_DATA_TYPE value ,
19694  PORTS_DATA_MASK mask ) ;
19695 // *****************************************************************************
19696 /* Function:
19697  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19698  PORTS_DATA_MASK toggleMask )
19699  Summary:
19700  Toggles the selected digital port/latch.
19701  Description:
19702  This function toggles the selected digital port/latch.
19703  This function does not perform atomic register access.
19704  Precondition:
19705  None.
19706  Parameters:
19707  index - Identifier for the device instance to be configured
19708  channel - Identifier for the Ports channel A, B, C, etc.
19709  toggleMask - Identifies the bits to be toggled
19710  Returns:
19711  None.
19712  Example:
19713  <code>
19714 
19715  // Toggles the three least significant Port C bits
19716  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19717 
19718  </code>
19719  Remarks:
19720  This feature may not be available on all devices. Please refer to the
19721  specific device data sheet to determine availability or use
19722  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19723  this feature is available.
19724 */
19725 
19726 void
19728  PORTS_MODULE_ID index ,
19729  PORTS_CHANNEL channel ,
19730  PORTS_DATA_MASK toggleMask ) ;
19731 // *****************************************************************************
19732 /* Function:
19733  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19734  PORTS_DATA_MASK clearMask )
19735  Summary:
19736  Clears the selected digital port/latch bits.
19737  Description:
19738  This function clears the selected digital port/latch bits.
19739  This function does not perform atomic register access.
19740  Precondition:
19741  None.
19742  Parameters:
19743  index - Identifier for the device instance to be configured
19744  channel - Identifier for the Ports channel A, B, C, etc.
19745  clearMask - Identifies the bits to be cleared
19746  Returns:
19747  None.
19748  Example:
19749  <code>
19750 
19751  // Clears the three least significant Port C bits
19752  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19753 
19754  </code>
19755  Remarks:
19756  This feature may not be available on all devices. Please refer to the
19757  specific device data sheet to determine availability or use
19758  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19759  this feature is available.
19760 */
19761 
19762 void
19764  PORTS_MODULE_ID index ,
19765  PORTS_CHANNEL channel ,
19766  PORTS_DATA_MASK clearMask ) ;
19767 // *****************************************************************************
19768 /* Function:
19769  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19770  PORTS_DATA_MASK mask )
19771  Summary:
19772  Makes the selected pins direction input.
19773  Description:
19774  This function makes the selected pins direction input.
19775  This function does not perform atomic register access.
19776 
19777  Precondition:
19778  None.
19779  Parameters:
19780  index - Identifier for the device instance to be configured
19781  channel - Identifier for the Ports channel A, B, C, etc.
19782  mask - Identifies the pins direction that has to be made input
19783  Returns:
19784  None.
19785  Example:
19786  <code>
19787 
19788  // Make RC0, RC1 and RC2 pins as Input
19789  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19790 
19791  </code>
19792  Remarks:
19793  This feature may not be available on all devices. Please refer to the
19794  specific device data sheet to determine availability or use
19795  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19796  this feature is available.
19797 */
19798 
19799 void
19801  PORTS_MODULE_ID index ,
19802  PORTS_CHANNEL channel ,
19803  PORTS_DATA_MASK mask ) ;
19804 // *****************************************************************************
19805 /* Function:
19806  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19807  PORTS_DATA_MASK mask )
19808  Summary:
19809  Makes the selected pins direction output.
19810  Description:
19811  This function makes the selected pins direction output.
19812  This function does not perform atomic register access.
19813  Precondition:
19814  None.
19815  Parameters:
19816  index - Identifier for the device instance to be configured
19817  channel - Identifier for the Ports channel A, B, C, etc.
19818  mask - Identifies the pins direction that has to be made output
19819  Returns:
19820  None.
19821  Example:
19822  <code>
19823 
19824  // Make RC0, RC1 and RC2 pins as Output
19825  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19826 
19827  </code>
19828  Remarks:
19829  This feature may not be available on all devices. Please refer to the
19830  specific device data sheet to determine availability or use
19831  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19832  this feature is available.
19833 */
19834 
19835 void
19837  PORTS_MODULE_ID index ,
19838  PORTS_CHANNEL channel ,
19839  PORTS_DATA_MASK mask ) ;
19840 // *****************************************************************************
19841 /* Function:
19842  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19843  Summary:
19844  Reads the direction of the selected digital port.
19845  Description:
19846  This function reads the direction of the selected digital port.
19847  This function does not perform atomic register access.
19848  Precondition:
19849  None.
19850  Parameters:
19851  index - Identifier for the device instance to be configured
19852  channel - Identifier for the Ports channel A, B, C, etc.
19853  Returns:
19854  Direction of the selected port of type PORTS_DATA_MASK
19855  Example:
19856  <code>
19857 
19858  // Reads the direction of Port C pins
19859  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
19860 
19861  </code>
19862  Remarks:
19863  This feature may not be available on all devices. Please refer to the
19864  specific device data sheet to determine availability or use
19865  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19866  this feature is available.
19867 */
19868 
19871  PORTS_MODULE_ID index ,
19872  PORTS_CHANNEL channel ) ;
19873 // *****************************************************************************
19874 /* Function:
19875  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19876  PORTS_DATA_MASK mask )
19877  Summary:
19878  Enables the open drain functionality for the selected port pins.
19879  Description:
19880  This function enables the open drain functionality for the selected port pins.
19881  This function does not perform atomic register access.
19882  Precondition:
19883  None.
19884  Parameters:
19885  index - Identifier for the device instance to be configured
19886  channel - Identifier for the Ports channel A, B, C, etc.
19887  mask - Identifies the pins for the open drain to be enabled
19888  Returns:
19889  None.
19890  Example:
19891  <code>
19892 
19893  // Enable Open Drain for RC0, RC1 and RC2 pins
19894  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19895 
19896  </code>
19897  Remarks:
19898  This feature may not be available on all devices. Please refer to the
19899  specific device data sheet to determine availability or use
19900  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19901  this feature is available.
19902 */
19903 
19904 void
19906  PORTS_MODULE_ID index ,
19907  PORTS_CHANNEL channel ,
19908  PORTS_DATA_MASK mask ) ;
19909 // *****************************************************************************
19910 /* Function:
19911  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19912  PORTS_DATA_MASK mask )
19913  Summary:
19914  Disables the open drain functionality for the selected port.
19915  Description:
19916  This function disables the open drain functionality for the selected port.
19917  This function does not perform atomic register access.
19918 
19919  Precondition:
19920  None.
19921  Parameters:
19922  index - Identifier for the device instance to be configured
19923  channel - Identifier for the Ports channel A, B, C, etc.
19924  mask - Identifies the pins for the open drain to be disabled
19925  Returns:
19926  None.
19927  Example:
19928  <code>
19929 
19930  // Disable Open Drain for RC0, RC1 and RC2 pins
19931  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19932 
19933  </code>
19934  Remarks:
19935  This feature may not be available on all devices. Please refer to the
19936  specific device data sheet to determine availability or use
19937  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19938  this feature is available.
19939 */
19940 
19941 void
19943  PORTS_MODULE_ID index ,
19944  PORTS_CHANNEL channel ,
19945  PORTS_DATA_MASK mask ) ;
19946 // *****************************************************************************
19947 /* Function:
19948  void PLIB_PORTS_ChannelModeSelect
19949  (
19950  PORTS_MODULE_ID index,
19951  PORTS_CHANNEL channel,
19952  PORTS_DATA_MASK modeMask,
19953  PORTS_PIN_MODE mode
19954  );
19955  Summary:
19956  Enables the selected channel pins as analog or digital.
19957  Description:
19958  This function enables the selected channel pins as analog or digital.
19959  This function does not perform atomic register access.
19960  Precondition:
19961  None.
19962  Parameters:
19963  index - Identifier for the device instance to be configured
19964  channel - Port pin channel
19965  modeMask - Identifies the pins whose mode has to be modified.
19966  Modes of the pins whose corresponding bit is '1' get
19967  modified, mode of the other pins remains the same.
19968  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
19969  Returns:
19970  None.
19971  Example:
19972  <code>
19973 
19974  // Make pins RC5, RC8 and RC13 Analog
19975  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
19976 
19977  </code>
19978  Remarks:
19979  This function is only available in devices with PPS. For Non-PPS devices, use the
19980  PLIB_PORTS_AnPinsModeSelect function.
19981 
19982  This feature may not be available on all devices. Please refer to the
19983  specific device data sheet to determine availability or use
19984  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19985  this feature is available.
19986 */
19987 
19988 void
19990  PORTS_MODULE_ID index ,
19991  PORTS_CHANNEL channel ,
19992  PORTS_DATA_MASK modeMask ,
19993  PORTS_PIN_MODE mode ) ;
19994 // *****************************************************************************
19995 /* Function:
19996  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
19997  (
19998  PORTS_MODULE_ID index,
19999  PORTS_CHANNEL channel,
20000  PORTS_DATA_MASK mask
20001  );
20002  Summary:
20003  Enables Change Notice pull-up for the selected channel pins.
20004  Description:
20005  This function enables the Change Notice pull-up for the selected
20006  channel pins.
20007  This function does not perform atomic register access.
20008  Precondition:
20009  None.
20010  Parameters:
20011  index - Identifier for the device instance to be configured
20012  channel - Port pin channel
20013  mask - Identifies the pins of the pull-up to be enabled
20014  Returns:
20015  None.
20016  Example:
20017  <code>
20018 
20019  // Enable pull-up for RC5, RC8 and RC13 pins
20020  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
20021  0x2120);
20022  </code>
20023  Remarks:
20024  This function is only available in devices with PPS. For Non-PPS devices, use the
20025  PLIB_PORTS_CnPinsPullUpEnable function.
20026 
20027  This feature may not be available on all devices. Please refer to the
20028  specific device data sheet to determine availability or use
20029  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
20030  determine whether this feature is available.
20031 */
20032 
20033 void
20035  PORTS_MODULE_ID index ,
20036  PORTS_CHANNEL channel ,
20037  PORTS_DATA_MASK mask ) ;
20038 // *****************************************************************************
20039 /* Function:
20040  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
20041  (
20042  PORTS_MODULE_ID index,
20043  PORTS_CHANNEL channel,
20044  PORTS_DATA_MASK mask
20045  );
20046  Summary:
20047  Disables Change Notice pull-up for the selected channel pins.
20048  Description:
20049  This function Disables the Change Notice pull-up for the selected
20050  channel pins.
20051  PLIB_PORTS_ChannelChangeNoticePullUpDisable
20052  Precondition:
20053  None.
20054  Parameters:
20055  index - Identifier for the device instance to be configured
20056  channel - Port pin channel
20057  mask - Identifies the pins of the pull-up to be disabled
20058  Returns:
20059  None.
20060  Example:
20061  <code>
20062 
20063  // Disable pull-up for RC5, RC8 and RC13 pins
20064  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
20065  0x2120);
20066  </code>
20067  Remarks:
20068  This function is only available in devices with PPS. For Non-PPS devices, use the
20069  PLIB_PORTS_CnPinsPullUpDisable function.
20070 
20071  This feature may not be available on all devices. Please refer to the
20072  specific device data sheet to determine availability or use
20073  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
20074  determine whether this feature is available.
20075 */
20076 
20077 void
20079  PORTS_MODULE_ID index ,
20080  PORTS_CHANNEL channel ,
20081  PORTS_DATA_MASK mask ) ;
20082 // *****************************************************************************
20083 /* Function:
20084  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
20085  (
20086  PORTS_MODULE_ID index,
20087  PORTS_CHANNEL channel,
20088  PORTS_DATA_MASK mask
20089  );
20090  Summary:
20091  Enables Change Notice pull-down for the selected channel pins.
20092  Description:
20093  This function enables the Change Notice pull-down for the selected
20094  channel pins.
20095  This function does not perform atomic register access.
20096  Precondition:
20097  None.
20098  Parameters:
20099  index - Identifier for the device instance to be configured
20100  channel - Port pin channel
20101  mask - Identifies the pins for the pull-down to be enabled
20102  Returns:
20103  None.
20104  Example:
20105  <code>
20106 
20107  // Enable pull-down for RC5, RC8 and RC13 pins
20108  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20109  0x2120);
20110  </code>
20111  Remarks:
20112  This feature may not be available on all devices. Please refer to the
20113  specific device data sheet to determine availability or use
20114  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20115  determine whether this feature is available.
20116 */
20117 
20118 void
20120  PORTS_MODULE_ID index ,
20121  PORTS_CHANNEL channel ,
20122  PORTS_DATA_MASK mask ) ;
20123 // *****************************************************************************
20124 /* Function:
20125  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20126  (
20127  PORTS_MODULE_ID index,
20128  PORTS_CHANNEL channel,
20129  PORTS_DATA_MASK mask
20130  );
20131  Summary:
20132  Disables Change Notice pull-down for the selected channel pins.
20133  Description:
20134  This function Disables the Change Notice pull-down for the selected
20135  channel pins.
20136  This function does not perform atomic register access.
20137  Precondition:
20138  None.
20139  Parameters:
20140  index - Identifier for the device instance to be configured
20141  channel - Port pin channel
20142  mask - Identifies the pins for the pull-down to be disabled
20143  Returns:
20144  None.
20145  Example:
20146  <code>
20147 
20148  // Disable pull-down for RC5, RC8 and RC13 pins
20149  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20150  0x2120);
20151  </code>
20152  Remarks:
20153  This feature may not be available on all devices. Please refer to the
20154  specific device data sheet to determine availability or use
20155  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20156  determine whether this feature is available.
20157 */
20158 
20159 void
20161  PORTS_MODULE_ID index ,
20162  PORTS_CHANNEL channel ,
20163  PORTS_DATA_MASK mask ) ;
20164 // *****************************************************************************
20165 /* Function:
20166  void PLIB_PORTS_ChannelChangeNoticeEnable
20167  (
20168  PORTS_MODULE_ID index,
20169  PORTS_CHANNEL channel,
20170  PORTS_DATA_MASK mask
20171  );
20172  Summary:
20173  Enables CN interrupt for the selected pins of a channel.
20174  Description:
20175  This function enables Change Notice interrupt for the selected port
20176  pins of a channel.
20177  This function does not perform atomic register access.
20178  Precondition:
20179  None.
20180  Parameters:
20181  index - Identifier for the device instance to be configured
20182  channel - Port pin channel
20183  mask - Identifies the pins for which change notification is
20184  to be enabled
20185  Returns:
20186  None.
20187  Example:
20188  <code>
20189 
20190  // Enable CN interrupt for RC5, RC8 and RC13 pins
20191  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20192 
20193  </code>
20194  Remarks:
20195  This function is only available in devices with PPS. For Non-PPS devices, use the
20196  PLIB_PORTS_CnPinsEnable function.
20197 
20198  This feature may not be available on all devices. Please refer to the
20199  specific device data sheet to determine availability or use
20200  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20201  determine whether this feature is available.
20202 */
20203 
20204 void
20206  PORTS_MODULE_ID index ,
20207  PORTS_CHANNEL channel ,
20208  PORTS_DATA_MASK mask ) ;
20209 // *****************************************************************************
20210 /* Function:
20211  void PLIB_PORTS_ChannelChangeNoticeDisable
20212  (
20213  PORTS_MODULE_ID index,
20214  PORTS_CHANNEL channel,
20215  PORTS_DATA_MASK mask
20216  );
20217  Summary:
20218  Disables CN interrupt for the selected pins of a channel.
20219  Description:
20220  This function Disables Change Notice interrupt for the selected port
20221  pins of a channel.
20222  This function does not perform atomic register access.
20223  Precondition:
20224  None.
20225  Parameters:
20226  index - Identifier for the device instance to be configured
20227  channel - Port pin channel
20228  mask - Identifies the pins for which change notification is
20229  to be disabled
20230  Returns:
20231  None.
20232  Example:
20233  <code>
20234 
20235  // Disable CN interrupt for RC5, RC8 and RC13 pins
20236  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20237 
20238  </code>
20239  Remarks:
20240  This function is only available in devices with PPS. For Non-PPS devices, use the
20241  PLIB_PORTS_CnPinsDisable function.
20242 
20243  This feature may not be available on all devices. Please refer to the
20244  specific device data sheet to determine availability or use
20245  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20246  determine whether this feature is available.
20247 */
20248 
20249 void
20251  PORTS_MODULE_ID index ,
20252  PORTS_CHANNEL channel ,
20253  PORTS_DATA_MASK mask ) ;
20254 // *****************************************************************************
20255 /* Function:
20256  void PLIB_PORTS_AnPinsModeSelect
20257  (
20258  PORTS_MODULE_ID index,
20259  PORTS_AN_PIN anPins,
20260  PORTS_PIN_MODE mode
20261  );
20262  Summary:
20263  Enables the selected AN pins as analog or digital.
20264  Description:
20265  This function enables the selected AN pins as analog or digital.
20266  This function does not perform atomic register access.
20267  Precondition:
20268  None.
20269  Parameters:
20270  index - Identifier for the device instance to be configured
20271  anPins - AN pins whose mode is to be changed. Multiple AN pins
20272  can be ORed.
20273  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20274  Returns:
20275  None.
20276  Example:
20277  <code>
20278 
20279  // Make pins AN5, AN8 and AN13 Analog
20280  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20281  PORTS_AN_PIN_8 |
20282  PORTS_AN_PIN_13,
20283  PORTS_PIN_MODE_ANALOG);
20284 
20285  </code>
20286  Remarks:
20287  This function is only available in devices without PPS feature. For PPS
20288  devices, use the PLIB_PORTS_ChannelModeSelect function.
20289 
20290  This feature may not be available on all devices. Please refer to the
20291  specific device data sheet to determine availability or use
20292  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20293  this feature is available.
20294 */
20295 
20296 void
20298  PORTS_MODULE_ID index ,
20299  PORTS_AN_PIN anPins ,
20300  PORTS_PIN_MODE mode ) ;
20301 // *****************************************************************************
20302 /* Function:
20303  void PLIB_PORTS_CnPinsPullUpEnable
20304  (
20305  PORTS_MODULE_ID index,
20306  PORTS_CN_PIN cnPins
20307  );
20308  Summary:
20309  Enables Change Notice pull-up for the selected channel pins.
20310  Description:
20311  This function enables the Change Notice pull-up for the selected
20312  channel pins.
20313  This function performs atomic register access.
20314  Precondition:
20315  None.
20316  Parameters:
20317  index - Identifier for the device instance to be configured
20318  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20319  can be ORed.
20320  Returns:
20321  None.
20322  Example:
20323  <code>
20324 
20325  // Enable pull-up for CN5, CN8 and CN13 pins
20326  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20327  CHANGE_NOTICE_PIN_8 |
20328  CHANGE_NOTICE_PIN_13);
20329 
20330  </code>
20331  Remarks:
20332  This function is only available in devices without PPS feature. For PPS
20333  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20334 
20335  This feature may not be available on all devices. Please refer to the
20336  specific device data sheet to determine availability or use
20337  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20338  determine whether this feature is available.
20339 */
20340 
20341 void
20343  PORTS_MODULE_ID index ,
20344  PORTS_CN_PIN cnPins ) ;
20345 // *****************************************************************************
20346 /* Function:
20347  void PLIB_PORTS_CnPinsPullUpDisable
20348  (
20349  PORTS_MODULE_ID index,
20350  PORTS_CN_PIN cnPins
20351  );
20352  Summary:
20353  Disables Change Notice pull-up for the selected channel pins.
20354  Description:
20355  This function Disables the Change Notice pull-up for the selected
20356  channel pins.
20357  This function performs atomic register access.
20358  Precondition:
20359  None.
20360  Parameters:
20361  index - Identifier for the device instance to be configured
20362  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20363  can be ORed.
20364  Returns:
20365  None.
20366  Example:
20367  <code>
20368 
20369  // Disable pull-up for CN5, CN8 and CN13 pins
20370  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20371  CHANGE_NOTICE_PIN_5 |
20372  CHANGE_NOTICE_PIN_8 |
20373  CHANGE_NOTICE_PIN_13);
20374 
20375  </code>
20376  Remarks:
20377  This function is only available in devices without PPS feature. For PPS
20378  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20379 
20380  This feature may not be available on all devices. Please refer to the
20381  specific device data sheet to determine availability or use
20382  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20383  determine whether this feature is available.
20384 */
20385 
20386 void
20388  PORTS_MODULE_ID index ,
20389  PORTS_CN_PIN cnPins ) ;
20390 // *****************************************************************************
20391 /* Function:
20392  void PLIB_PORTS_CnPinsEnable
20393  (
20394  PORTS_MODULE_ID index,
20395  PORTS_CN_PIN cnPins
20396  );
20397  Summary:
20398  Enables CN interrupt for the selected pins of a channel.
20399  Description:
20400  This function enables Change Notice interrupt for the selected port
20401  pins of a channel.
20402  This function performs atomic register access.
20403  Precondition:
20404  None.
20405  Parameters:
20406  index - Identifier for the device instance to be configured
20407  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20408  Returns:
20409  None.
20410  Example:
20411  <code>
20412 
20413  // Enable CN interrupt for CN5, CN8 and CN13 pins
20414  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20415  CHANGE_NOTICE_PIN_5 |
20416  CHANGE_NOTICE_PIN_8 |
20417  CHANGE_NOTICE_PIN_13);
20418 
20419  </code>
20420  Remarks:
20421  This function is only available in devices without PPS feature. For PPS
20422  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20423 
20424  This feature may not be available on all devices. Please refer to the
20425  specific device data sheet to determine availability or use
20426  PLIB_PORTS_ExistsPinChangeNotice in your application to
20427  determine whether this feature is available.
20428 */
20429 
20430 void
20432  PORTS_MODULE_ID index ,
20433  PORTS_CN_PIN cnPins ) ;
20434 // *****************************************************************************
20435 /* Function:
20436  void PLIB_PORTS_CnPinsDisable
20437  (
20438  PORTS_MODULE_ID index,
20439  PORTS_CN_PIN cnPins
20440  );
20441  Summary:
20442  Disables CN interrupt for the selected pins of a channel.
20443  Description:
20444  This function Disables Change Notice interrupt for the selected port
20445  pins of a channel.
20446  This function performs atomic register access.
20447  Precondition:
20448  None.
20449  Parameters:
20450  index - Identifier for the device instance to be configured
20451  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20452  Returns:
20453  None.
20454  Example:
20455  <code>
20456 
20457  // Disable CN interrupt for CN5, CN8 and CN13 pins
20458  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20459  CHANGE_NOTICE_PIN_5 |
20460  CHANGE_NOTICE_PIN_8 |
20461  CHANGE_NOTICE_PIN_13);
20462 
20463  </code>
20464  Remarks:
20465  This function is only available in devices without PPS feature. For PPS
20466  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20467 
20468  This feature may not be available on all devices. Please refer to the
20469  specific device data sheet to determine availability or use
20470  PLIB_PORTS_ExistsPinChangeNotice in your application to
20471  determine whether this feature is available.
20472 */
20473 
20474 void
20476  PORTS_MODULE_ID index ,
20477  PORTS_CN_PIN cnPins ) ;
20478 // *****************************************************************************
20479 /* Function:
20480  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20481  Summary:
20482  Global Change Notice enable.
20483  Description:
20484  This function enables the global Change Notice feature.
20485  This function performs atomic register access.
20486  Precondition:
20487  None.
20488  Parameters:
20489  index - Identifier for the device instance to be configured
20490  Returns:
20491  None.
20492  Example:
20493  <code>
20494 
20495  // Enable Change Notification
20496  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20497 
20498  </code>
20499  Remarks:
20500  This function is only available in devices without PPS. For PPS devices, use the
20501  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20502 
20503  This feature may not be available on all devices. Please refer to the
20504  specific device data sheet to determine availability or use
20505  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20506  this feature is available.
20507 */
20508 
20509 void
20511  PORTS_MODULE_ID index ) ;
20512 // *****************************************************************************
20513 /* Function:
20514  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20515  Summary:
20516  Global Change Notice disable.
20517  Description:
20518  This function disables the global Change Notice feature.
20519  Precondition:
20520  None.
20521  Parameters:
20522  index - Identifier for the device instance to be configured
20523  Returns:
20524  None.
20525  Example:
20526  <code>
20527 
20528  // Disable Change Notification
20529  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20530 
20531  </code>
20532  Remarks:
20533  This function is only available in devices without PPS. For PPS devices, use the
20534  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20535 
20536  This feature may not be available on all devices. Please refer to the
20537  specific device data sheet to determine availability or use
20538  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20539  this feature is available.
20540 */
20541 
20542 void
20544  PORTS_MODULE_ID index ) ;
20545 // *****************************************************************************
20546 /* Function:
20547  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20548  PORTS_CHANGE_NOTICE_PIN pinNum )
20549  Summary:
20550  Port pin Change Notice interrupt enable.
20551  Description:
20552  This function enables the port pin Change Notice feature.
20553  This function performs atomic register access.
20554  Precondition:
20555  None.
20556  Parameters:
20557  index - Identifier for the device instance to be configured
20558  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20559  Returns:
20560  None.
20561  Example:
20562  <code>
20563 
20564  // Enable Change Notice interrupt for pin CN13
20565  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20566 
20567  </code>
20568  Remarks:
20569  This function is only available in devices without PPS. For PPS devices, use the
20570  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20571 
20572  This feature may not be available on all devices. Please refer to the
20573  specific device data sheet to determine availability or use
20574  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20575  this feature is available.
20576 */
20577 
20578 void
20580  PORTS_MODULE_ID index ,
20581  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20582 // *****************************************************************************
20583 /* Function:
20584  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20585  PORTS_CHANGE_NOTICE_PIN pinNum )
20586  Summary:
20587  Port pin Change Notice disable.
20588  Description:
20589  This function disables the port pin Change Notice feature.
20590  This function performs atomic register access.
20591  Precondition:
20592  None.
20593  Parameters:
20594  index - Identifier for the device instance to be configured
20595  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20596  Returns:
20597  None.
20598  Example:
20599  <code>
20600 
20601  // Disable Change Notice interrupt for pin CN13
20602  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20603 
20604  </code>
20605  Remarks:
20606  This function is only available in devices without PPS. For PPS devices, use the
20607  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20608 
20609  This feature may not be available on all devices. Please refer to the
20610  specific device data sheet to determine availability or use
20611  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20612  this feature is available.
20613 */
20614 
20615 void
20617  PORTS_MODULE_ID index ,
20618  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20619 // *****************************************************************************
20620 /* Function:
20621  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20622  Summary:
20623  CPU Idle mode does not affect Change Notice operation.
20624  Description:
20625  This function makes sure that Change Notice feature continues working in
20626  Idle mode.
20627  This function performs atomic register access.
20628 
20629  Precondition:
20630  None.
20631  Parameters:
20632  index - Identifier for the device instance to be configured
20633  Returns:
20634  None.
20635  Example:
20636  <code>
20637 
20638  // Change notification feature will be working even when CPU goes to
20639  // Idle mode
20640  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
20641 
20642  </code>
20643  Remarks:
20644  This function is only available in devices without PPS. For PPS devices, use the
20645  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
20646 
20647  This feature may not be available on all devices. Please refer to the
20648  specific device data sheet to determine availability or use
20649  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20650  this feature is available.
20651 */
20652 
20653 void
20655  PORTS_MODULE_ID index ) ;
20656 // *****************************************************************************
20657 /* Function:
20658  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
20659  Summary:
20660  CPU Idle halts the Change Notice operation.
20661  Description:
20662  This function halts the Change Notice operation when the CPU enters
20663  Idle mode.
20664  This function performs atomic register access.
20665  Precondition:
20666  None.
20667  Parameters:
20668  index - Identifier for the device instance to be configured
20669  Returns:
20670  None.
20671  Example:
20672  <code>
20673  // Halts the Change notification operation when CPU enters Idle mode
20674  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
20675 
20676  </code>
20677  Remarks:
20678  This function is only available in devices without PPS. For PPS devices, use the
20679  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
20680 
20681  This feature may not be available on all devices. Please refer to the
20682  specific device data sheet to determine availability or use
20683  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20684  this feature is available.
20685 */
20686 
20687 void
20689  PORTS_MODULE_ID index ) ;
20690 // *****************************************************************************
20691 /* Function:
20692  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
20693  PORTS_CHANGE_NOTICE_PIN pinNum )
20694  Summary:
20695  Enable pull-up on input change.
20696  Description:
20697  This function enables pull-up on selected input change notification pin.
20698  This function performs atomic register access.
20699  Precondition:
20700  None.
20701  Parameters:
20702  index - Identifier for the device instance to be configured
20703  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20704  Returns:
20705  None.
20706  Example:
20707  <code>
20708 
20709  // Enable pull-up on pin CN13
20710  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
20711 
20712  </code>
20713  Remarks:
20714  This function is only available in devices without PPS. For PPS devices, use the
20715  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
20716 
20717  This feature may not be available on all devices. Please refer to the
20718  specific device data sheet to determine availability or use
20719  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20720  this feature is available.
20721 */
20722 
20723 void
20725  PORTS_MODULE_ID index ,
20726  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20727 // *****************************************************************************
20728 /* Function:
20729  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
20730  PORTS_CHANGE_NOTICE_PIN pinNum )
20731  Summary:
20732  Disable pull-up on input change.
20733  Description:
20734  This function disables pull-up on selected input change notification pin.
20735  This function performs atomic register access.
20736  Precondition:
20737  None.
20738  Parameters:
20739  index - Identifier for the device instance to be configured
20740  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20741  Returns:
20742  None.
20743  Example:
20744  <code>
20745 
20746  // Disable pull-up on pin CN13
20747  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
20748 
20749  </code>
20750  Remarks:
20751  This function is only available in devices without PPS. For PPS devices, use the
20752  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
20753 
20754  This feature may not be available on all devices. Please refer to the
20755  specific device data sheet to determine availability or use
20756  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20757  this feature is available.
20758 */
20759 
20760 void
20762  PORTS_MODULE_ID index ,
20763  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20764 // *****************************************************************************
20765 /* Function:
20766  void PLIB_PORTS_ChannelSlewRateSelect
20767  (
20768  PORTS_MODULE_ID index,
20769  PORTS_CHANNEL channel,
20770  PORTS_DATA_MASK channelMask,
20771  PORTS_PIN_SLEW_RATE slewRate
20772  );
20773  Summary:
20774  Selects the slew rate for selected channel pins.
20775  Description:
20776  This function selects the slew rate for selected channel pins.
20777  This function does not perform atomic register access.
20778  Precondition:
20779  None.
20780  Parameters:
20781  index - Identifier for the device instance to be configured
20782  channel - Port pin channel
20783  channelMask - Identifies the pins for which slew rate has to be modified.
20784  Slew rate of the pins which corresponding bit is "1" get
20785  modified, slew rate of the other pins remains the same.
20786  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
20787  Returns:
20788  None.
20789  Example:
20790  <code>
20791 
20792  // Make slew rate of pins RC5, RC8 and RC13 slowest
20793  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
20794  PORT_CHANNEL_C,
20795  0x2120,
20796  PORTS_PIN_SLEW_RATE_SLOWEST);
20797 
20798  </code>
20799  Remarks:
20800  This feature may not be available on all devices. Please refer to the
20801  specific device data sheet to determine availability or use
20802  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20803  whether this feature is available.
20804 */
20805 
20806 void
20808  PORTS_MODULE_ID index ,
20809  PORTS_CHANNEL channel ,
20810  PORTS_DATA_MASK channelMask ,
20811  PORTS_PIN_SLEW_RATE slewRate ) ;
20812 // *****************************************************************************
20813 /* Function:
20814 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
20815  (
20816  PORTS_MODULE_ID index,
20817  PORTS_CHANNEL channel,
20818  PORTS_BIT_POS bitPos
20819  );
20820  Summary:
20821  Gets the slew rate for selected port pin.
20822  Description:
20823  This function gets the slew rate of selected port pin.
20824  This function does not perform atomic register access.
20825  Precondition:
20826  None.
20827  Parameters:
20828  index - Identifier for the device instance to be configured
20829  channel - Port pin channel
20830  bitPos - One of the possible values of PORTS_BIT_POS.
20831  Returns:
20832  One of the possible values of PORTS_PIN_SLEW_RATE.
20833  Example:
20834  <code>
20835  PORTS_PIN_SLEW_RATE slewRate;
20836 
20837  // Get the slew rate of pin RC1
20838  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
20839 
20840  </code>
20841  Remarks:
20842  This feature may not be available on all devices. Please refer to the
20843  specific device data sheet to determine availability or use
20844  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20845  whether this feature is available.
20846 */
20847 
20848 PORTS_PIN_SLEW_RATE
20850  PORTS_MODULE_ID index ,
20851  PORTS_CHANNEL channel ,
20852  PORTS_BIT_POS bitPos ) ;
20853 // *****************************************************************************
20854 /* Function:
20855  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
20856  (
20857  PORTS_MODULE_ID index,
20858  PORTS_CHANNEL channel,
20859  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
20860  );
20861  Summary:
20862  Selects the Change Notice style for selected port channel.
20863  Description:
20864  This function selects the Change Notice style (or method) for selected port
20865  channel. It allows user to select whether the Change Notice detection will
20866  happen based on edge transition or level transition on all the CN pins of a
20867  particular channel.
20868  This function does not perform atomic register access.
20869  Precondition:
20870  None.
20871  Parameters:
20872  index - Identifier for the device instance to be configured
20873  channel - Port pin channel
20874  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20875  Returns:
20876  None.
20877  Example:
20878  <code>
20879  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
20880  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
20881  </code>
20882  Remarks:
20883  This feature may not be available on all devices. Please refer to the
20884  specific device data sheet to determine availability or use
20885  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20886  whether this feature is available.
20887 */
20888 
20889 void
20891  PORTS_MODULE_ID index ,
20892  PORTS_CHANNEL channel ,
20893  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
20894 // *****************************************************************************
20895 /* Function:
20896  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
20897  (
20898  PORTS_MODULE_ID index,
20899  PORTS_CHANNEL channel
20900  );
20901  Summary:
20902  Gets the Change Notice style for the selected port channel.
20903  Description:
20904  This function gets the Change Notice style (or method) for the selected port
20905  channel.
20906  This function does not perform atomic register access.
20907  Precondition:
20908  None.
20909  Parameters:
20910  index - Identifier for the device instance to be configured
20911  channel - Port pin channel
20912  Returns:
20913  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20914  Example:
20915  <code>
20916  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
20917  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
20918  </code>
20919  Remarks:
20920  This feature may not be available on all devices. Please refer to the
20921  specific device data sheet to determine availability or use
20922  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20923  whether this feature is available.
20924 */
20925 
20926 PORTS_CHANGE_NOTICE_METHOD
20928  PORTS_MODULE_ID index ,
20929  PORTS_CHANNEL channel ) ;
20930 // *****************************************************************************
20931 /* Function:
20932  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
20933  (
20934  PORTS_MODULE_ID index,
20935  PORTS_CHANNEL channel,
20936  PORTS_DATA_MASK edgeRisingMask,
20937  PORTS_DATA_MASK edgeFallingMask
20938  );
20939  Summary:
20940  Enables selected type of edge for selected CN pins.
20941  Description:
20942  This function Enables selected type of edge (falling or rising) for
20943  selected CN pins of a port channel.
20944  This function does not perform atomic register access.
20945  Precondition:
20946  Change Notice method should be selected as
20947  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20948  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20949  Parameters:
20950  index - Identifier for the device instance to be configured
20951  channel - Port pin channel
20952  edgeRisingMask - Identifies the pins for which Change Notice has to be
20953  enabled for rising edge. Change Notice interrupt at rising
20954  edge is enabled for the pins which corresponding bit is
20955  '1', for the other pins it remains the same.
20956  edgeFallingMask - Identifies the pins for which Change Notice has to be
20957  enabled for falling edge. Change Notice interrupt at
20958  falling edge is enabled for the pins which corresponding
20959  bit is '1', for the other pins it remains the same.
20960  Returns:
20961  None.
20962  Example:
20963  <code>
20964  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
20965  // RC1 & RC5 pins.
20966  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20967  </code>
20968  Remarks:
20969  This feature is not available on all devices. Please refer to the
20970  specific device data sheet to determine availability or use
20971  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20972  whether this feature is available.
20973 */
20974 
20975 void
20977  PORTS_MODULE_ID index ,
20978  PORTS_CHANNEL channel ,
20979  PORTS_DATA_MASK edgeRisingMask ,
20980  PORTS_DATA_MASK edgeFallingMask ) ;
20981 // *****************************************************************************
20982 /* Function:
20983  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
20984  (
20985  PORTS_MODULE_ID index,
20986  PORTS_CHANNEL channel,
20987  PORTS_DATA_MASK edgeRisingMask,
20988  PORTS_DATA_MASK edgeFallingMask
20989  );
20990  Summary:
20991  Disables selected type of edge for selected CN pins.
20992  Description:
20993  This function Disables selected type of edge (falling or rising) for
20994  selected CN pins of a port channel.
20995  This function does not perform atomic register access.
20996  Precondition:
20997  Change Notice method should be selected as
20998  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20999  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
21000  Parameters:
21001  index - Identifier for the device instance to be configured
21002  channel - Port pin channel
21003  edgeRisingMask - Identifies the pins for which Change Notice has to be
21004  enabled for rising edge. Change notice interrupt at rising
21005  edge is enabled for the pins which corresponding bit is
21006  '1', for the other pins it remains the same.
21007  edgeFallingMask - Identifies the pins for which Change Notice has to be
21008  enabled for falling edge. Change notice interrupt at
21009  falling edge is enabled for the pins which corresponding
21010  bit is '1', for the other pins it remains the same.
21011  Returns:
21012  None.
21013  Example:
21014  <code>
21015  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
21016  // RC1 & RC5 pins.
21017  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
21018  </code>
21019  Remarks:
21020  This feature is not available on all devices. Please refer to the
21021  specific device data sheet to determine availability or use
21022  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
21023  whether this feature is available.
21024 */
21025 
21026 void
21028  PORTS_MODULE_ID index ,
21029  PORTS_CHANNEL channel ,
21030  PORTS_DATA_MASK edgeRisingMask ,
21031  PORTS_DATA_MASK edgeFallingMask ) ;
21032 // *****************************************************************************
21033 /* Function:
21034  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21035  (
21036  PORTS_MODULE_ID index,
21037  PORTS_CHANNEL channel,
21038  PORTS_BIT_POS bitPos,
21039  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
21040  );
21041  Summary:
21042  Check if Change Notice edge is enabled or not.
21043  This function does not perform atomic register access.
21044  Description:
21045  This function checks if selected type of Change Notice edge is enabled on a
21046  particular port pin or not.
21047  This function does not perform atomic register access.
21048  Precondition:
21049  None.
21050  Parameters:
21051  index - Identifier for the device instance to be configured
21052  channel - Port pin channel
21053  bitPos - One of the possible values of PORTS_BIT_POS.
21054  cnEdgeType - Type of the edge which has to be checked.
21055 
21056  Returns:
21057  - true - Selected type of Change Notice Edge is enabled.
21058  - false - Selected type of Change Notice Edge is not enabled.
21059 
21060  Example:
21061  <code>
21062  // Check if Change Notice at rising edge is enabled or not for pin RC1.
21063  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
21064  {
21065  // do something
21066  }
21067  </code>
21068  Remarks:
21069  This feature is not available on all devices. Please refer to the
21070  specific device data sheet to determine availability or use
21071  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
21072  whether this feature is available.
21073 */
21074 
21075 bool
21077  PORTS_MODULE_ID index ,
21078  PORTS_CHANNEL channel ,
21079  PORTS_BIT_POS bitPos ,
21080  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
21081 // *****************************************************************************
21082 /* Function:
21083  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21084  (
21085  PORTS_MODULE_ID index,
21086  PORTS_CHANNEL channel,
21087  PORTS_BIT_POS bitPos
21088  );
21089  Summary:
21090  Check Change Notice edge status.
21091  Description:
21092  This function checks whether or no a Change Notice edge transition has occurred
21093  on the selected port pin.
21094  This function does not perform atomic register access.
21095  Precondition:
21096  None.
21097  Parameters:
21098  index - Identifier for the device instance to be configured
21099  channel - Port pin channel
21100  bitPos - One of the possible values of PORTS_BIT_POS
21101 
21102  Returns:
21103  - true - Change Notice edge transition has occurred
21104  - false - Change Notice edge transition has not occurred
21105 
21106  Example:
21107  <code>
21108  // Check if Change Notice edge transition has occurred for pin RC1.
21109  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21110  {
21111  // do something
21112  }
21113  </code>
21114  Remarks:
21115  This feature is not available on all devices. Please refer to the
21116  specific device data sheet to determine availability or use
21117  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21118  whether this feature is available.
21119 */
21120 
21121 bool
21123  PORTS_MODULE_ID index ,
21124  PORTS_CHANNEL channel ,
21125  PORTS_BIT_POS bitPos ) ;
21126 // *****************************************************************************
21127 // *****************************************************************************
21128 // Section: Ports Peripheral Library Exists Functions
21129 // *****************************************************************************
21130 // *****************************************************************************
21131 /* The functions below indicate the existence of the features on the device.
21132 */
21133 //******************************************************************************
21134 /* Function:
21135  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21136  Summary:
21137  Identifies whether the RemapInput feature exists on the Ports module.
21138  Description:
21139  This function identifies whether the RemapInput feature is available on the
21140  Ports module.
21141  When this function returns true, this function is supported on the device:
21142  - PLIB_PORTS_RemapInput
21143  Preconditions:
21144  None.
21145  Parameters:
21146  index - Identifier for the device instance
21147  Returns:
21148  - true - The RemapInput feature is supported on the device
21149  - false - The RemapInput feature is not supported on the device
21150  Remarks:
21151  None.
21152 */
21153 
21154 bool
21156  PORTS_MODULE_ID index ) ;
21157 //******************************************************************************
21158 /* Function:
21159  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21160  Summary:
21161  Identifies whether the RemapOutput feature exists on the Ports module.
21162  Description:
21163  This function identifies whether the RemapOutput feature is available on the
21164  Ports module.
21165  When this function returns true, this function is supported on the device:
21166  - PLIB_PORTS_RemapOutput
21167  Preconditions:
21168  None.
21169  Parameters:
21170  index - Identifier for the device instance
21171  Returns:
21172  - true - The RemapOutput feature is supported on the device
21173  - false - The RemapOutput feature is not supported on the device
21174  Remarks:
21175  None.
21176 */
21177 
21178 bool
21180  PORTS_MODULE_ID index ) ;
21181 //******************************************************************************
21182 /* Function:
21183  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21184  Summary:
21185  Identifies whether the PinMode feature exists on the Ports module.
21186  Description:
21187  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21188  feature is available on the Ports module.
21189  When this function returns true, this function is supported on the device:
21190  - PLIB_PORTS_PinModeSelect
21191  Preconditions:
21192  None.
21193  Parameters:
21194  index - Identifier for the device instance
21195  Returns:
21196  - true - The PinMode feature is supported on the device
21197  - false - The PinMode feature is not supported on the device
21198  Remarks:
21199  None.
21200 */
21201 
21202 bool
21204  PORTS_MODULE_ID index ) ;
21205 //******************************************************************************
21206 /* Function:
21207  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21208  Summary:
21209  Identifies whether the AnPinsMode feature exists on the Ports module.
21210  Description:
21211  This function identifies whether the AnPinsMode feature is available on the
21212  Ports module.
21213  When this function returns true, this function is supported on the device:
21214  - PLIB_PORTS_AnPinsModeSelect
21215  Preconditions:
21216  None.
21217  Parameters:
21218  index - Identifier for the device instance
21219  Returns:
21220  - true - The AnPinsMode feature is supported on the device
21221  - false - The AnPinsMode feature is not supported on the device
21222  Remarks:
21223  None.
21224 */
21225 
21226 bool
21228  PORTS_MODULE_ID index ) ;
21229 //******************************************************************************
21230 /* Function:
21231  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21232  Summary:
21233  Identifies whether the PortsRead feature exists on the Ports module.
21234  Description:
21235  This function identifies whether the PortsRead feature is available on the
21236  Ports module.
21237  When this function returns true, these functions are supported on the device:
21238  - PLIB_PORTS_PinGet
21239  - PLIB_PORTS_Read
21240  Preconditions:
21241  None.
21242  Parameters:
21243  index - Identifier for the device instance
21244  Returns:
21245  - true - The PortsRead feature is supported on the device
21246  - false - The PortsRead feature is not supported on the device
21247  Remarks:
21248  None.
21249 */
21250 
21251 bool
21253  PORTS_MODULE_ID index ) ;
21254 //******************************************************************************
21255 /* Function:
21256  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21257  Summary:
21258  Identifies whether the LatchRead feature exists on the Ports module.
21259  Description:
21260  This function identifies whether the LatchRead feature is available on the
21261  Ports module.
21262  When this function returns true, these functions are supported on the device:
21263  - PLIB_PORTS_PinGetLatched
21264  - PLIB_PORTS_ReadLatched
21265  Preconditions:
21266  None.
21267  Parameters:
21268  index - Identifier for the device instance
21269  Returns:
21270  - true - The LatchRead feature is supported on the device
21271  - false - The LatchRead feature is not supported on the device
21272  Remarks:
21273  None.
21274 */
21275 
21276 bool
21278  PORTS_MODULE_ID index ) ;
21279 //******************************************************************************
21280 /* Function:
21281  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21282  Summary:
21283  Identifies whether the PortsWrite feature exists on the Ports module.
21284  Description:
21285  This function identifies whether the PortsWrite feature is available on the
21286  Ports module.
21287  When this function returns true, these functions are supported on the device:
21288  - PLIB_PORTS_PinWrite
21289  - PLIB_PORTS_PinSet
21290  - PLIB_PORTS_PinClear
21291  - PLIB_PORTS_PinToggle
21292  - PLIB_PORTS_Write
21293  - PLIB_PORTS_Set
21294  - PLIB_PORTS_Toggle
21295  - PLIB_PORTS_Clear
21296  Preconditions:
21297  None.
21298  Parameters:
21299  index - Identifier for the device instance
21300  Returns:
21301  - true - The PortsWrite feature is supported on the device
21302  - false - The PortsWrite feature is not supported on the device
21303  Remarks:
21304  None.
21305 */
21306 
21307 bool
21309  PORTS_MODULE_ID index ) ;
21310 //******************************************************************************
21311 /* Function:
21312  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21313  Summary:
21314  Identifies whether the PortsDirection feature exists on the Ports module.
21315  Description:
21316  This function identifies whether the PortsDirection feature is available on the
21317  Ports module.
21318  When this function returns true, these functions are supported on the device:
21319  - PLIB_PORTS_PinDirectionInputSet
21320  - PLIB_PORTS_PinDirectionOutputSet
21321  - PLIB_PORTS_DirectionInputSet
21322  - PLIB_PORTS_DirectionOutputSet
21323  - PLIB_PORTS_DirectionGet
21324  Preconditions:
21325  None.
21326  Parameters:
21327  index - Identifier for the device instance
21328  Returns:
21329  - true - The PortsDirection feature is supported on the device
21330  - false - The PortsDirection feature is not supported on the device
21331  Remarks:
21332  None.
21333 */
21334 
21335 bool
21337  PORTS_MODULE_ID index ) ;
21338 //******************************************************************************
21339 /* Function:
21340  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21341  Summary:
21342  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21343  Description:
21344  This function identifies whether the PortsOpenDrain feature is available on
21345  the Ports module.
21346  When this function returns true, these functions are supported on the device:
21347  - PLIB_PORTS_PinOpenDrainEnable
21348  - PLIB_PORTS_PinOpenDrainDisable
21349  - PLIB_PORTS_OpenDrainEnable
21350  - PLIB_PORTS_OpenDrainDisable
21351  Preconditions:
21352  None.
21353  Parameters:
21354  index - Identifier for the device instance
21355  Returns:
21356  - true - The PortsOpenDrain feature is supported on the device
21357  - false - The PortsOpenDrain feature is not supported on the device
21358  Remarks:
21359  None.
21360 */
21361 
21362 bool
21364  PORTS_MODULE_ID index ) ;
21365 //******************************************************************************
21366 /* Function:
21367  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21368  Summary:
21369  Identifies whether the ChangeNotice feature exists on the Ports module.
21370  Description:
21371  This function identifies whether the ChangeNotice feature is available on the
21372  Ports module.
21373  When this function returns true, these functions are supported on the device:
21374  - PLIB_PORTS_ChangeNoticeEnable
21375  - PLIB_PORTS_ChangeNoticeDisable
21376  Preconditions:
21377  None.
21378  Parameters:
21379  index - Identifier for the device instance
21380  Returns:
21381  - true - The ChangeNotice feature is supported on the device
21382  - false - The ChangeNotice feature is not supported on the device
21383  Remarks:
21384  None.
21385 */
21386 
21387 bool
21389  PORTS_MODULE_ID index ) ;
21390 //******************************************************************************
21391 /* Function:
21392  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21393  Summary:
21394  Identifies whether the PinChangeNotice feature exists on the Ports module.
21395  Description:
21396  This function identifies whether the PinChangeNotice feature is available on
21397  the Ports module.
21398  When this function returns true, these functions are supported on the device:
21399  - PLIB_PORTS_PinChangeNoticeEnable
21400  - PLIB_PORTS_PinChangeNoticeDisable
21401  - PLIB_PORTS_CnPinsEnable
21402  - PLIB_PORTS_CnPinsDisable
21403  Preconditions:
21404  None.
21405  Parameters:
21406  index - Identifier for the device instance
21407  Returns:
21408  - true - The PinChangeNotice feature is supported on the device
21409  - false - The PinChangeNotice feature is not supported on the device
21410  Remarks:
21411  None.
21412 */
21413 
21414 bool
21416  PORTS_MODULE_ID index ) ;
21417 //******************************************************************************
21418 /* Function:
21419  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21420  Summary:
21421  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21422  Description:
21423  This function identifies whether the ChangeNoticeInIdle feature is available
21424  on the Ports module.
21425  When this function returns true, these functions are supported on the device:
21426  - PLIB_PORTS_ChangeNoticeInIdleEnable
21427  - PLIB_PORTS_ChangeNoticeInIdleDisable
21428  Preconditions:
21429  None.
21430  Parameters:
21431  index - Identifier for the device instance
21432  Returns:
21433  - true - The ChangeNoticeInIdle feature is supported on the device
21434  - false - The ChangeNoticeInIdle feature is not supported on the device
21435  Remarks:
21436  None.
21437 */
21438 
21439 bool
21441  PORTS_MODULE_ID index ) ;
21442 //******************************************************************************
21443 /* Function:
21444  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21445  Summary:
21446  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21447  Description:
21448  This function identifies whether the ChangeNoticePullup feature is available
21449  on the Ports module.
21450  When this function returns true, these functions are supported on the device:
21451  - PLIB_PORTS_ChangeNoticePullUpEnable
21452  - PLIB_PORTS_ChangeNoticePullUpDisable
21453  - PLIB_PORTS_CnPinsPullUpEnable
21454  - PLIB_PORTS_CnPinsPullUpDisable
21455  Preconditions:
21456  None.
21457  Parameters:
21458  index - Identifier for the device instance
21459  Returns:
21460  - true - The ChangeNoticePullup feature is supported on the device
21461  - false - The ChangeNoticePullup feature is not supported on the device
21462  Remarks:
21463  None.
21464 */
21465 
21466 bool
21468  PORTS_MODULE_ID index ) ;
21469 //******************************************************************************
21470 /* Function:
21471  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21472  Summary:
21473  Identifies whether the PinModePerPort feature exists on the Ports module.
21474  Description:
21475  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21476  feature is available on the Ports module.
21477  When this function returns true, these functions are supported on the device:
21478  - PLIB_PORTS_PinModePerPortSelect
21479  - PLIB_PORTS_ChannelModeSelect
21480  Preconditions:
21481  None.
21482  Parameters:
21483  index - Identifier for the device instance
21484  Returns:
21485  - true - The PinModePerPort feature is supported on the device
21486  - false - The PinModePerPort feature is not supported on the device
21487  Remarks:
21488  None.
21489 */
21490 
21491 bool
21493  PORTS_MODULE_ID index ) ;
21494 //******************************************************************************
21495 /* Function:
21496  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21497  Summary:
21498  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21499  Ports module.
21500  Description:
21501  This function identifies whether the ChangeNoticePullDownPerPort feature is
21502  available on the Ports module.
21503  When this function returns true, these functions are supported on the device:
21504  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21505  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21506  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21507  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21508  Preconditions:
21509  None.
21510  Parameters:
21511  index - Identifier for the device instance
21512  Returns:
21513  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21514  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21515  Remarks:
21516  None.
21517 */
21518 
21519 bool
21521  PORTS_MODULE_ID index ) ;
21522 //******************************************************************************
21523 /* Function:
21524  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21525  Summary:
21526  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21527  module.
21528  Description:
21529  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21530  on the Ports module.
21531  When this function returns true, these functions are supported on the device:
21532  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21533  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21534  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21535  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21536  Preconditions:
21537  None.
21538  Parameters:
21539  index - Identifier for the device instance
21540  Returns:
21541  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21542  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21543  Remarks:
21544  None.
21545 */
21546 
21547 bool
21549  PORTS_MODULE_ID index ) ;
21550 //******************************************************************************
21551 /* Function:
21552  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21553  Summary:
21554  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21555  module.
21556  Description:
21557  This function identifies whether the PinChangeNoticePerPort feature is
21558  available on the Ports module.
21559  When this function returns true, these functions are supported on the device:
21560  - PLIB_PORTS_PinChangeNoticePerPortEnable
21561  - PLIB_PORTS_PinChangeNoticePerPortDisable
21562  - PLIB_PORTS_ChannelChangeNoticeEnable
21563  - PLIB_PORTS_ChannelChangeNoticeDisable
21564  Preconditions:
21565  None.
21566  Parameters:
21567  index - Identifier for the device instance
21568  Returns:
21569  - true - The PinChangeNoticePerPort feature is supported on the device
21570  - false - The PinChangeNoticePerPort feature is not supported on the device
21571  Remarks:
21572  None.
21573 */
21574 
21575 bool
21577  PORTS_MODULE_ID index ) ;
21578 //******************************************************************************
21579 /* Function:
21580  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21581  Summary:
21582  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21583  module.
21584  Description:
21585  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21586  available on the Ports module.
21587  When this function returns true, these functions are supported on the device:
21588  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21589  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21590  Preconditions:
21591  None.
21592  Parameters:
21593  index - Identifier for the device instance
21594  Returns:
21595  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21596  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21597  Remarks:
21598  None.
21599 */
21600 
21601 bool
21603  PORTS_MODULE_ID index ) ;
21604 //******************************************************************************
21605 /* Function:
21606  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21607  Summary:
21608  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21609  module.
21610  Description:
21611  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21612  available on the Ports module.
21613  When this function returns true, these functions are supported on the device:
21614  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21615  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21616  Preconditions:
21617  None.
21618  Parameters:
21619  index - Identifier for the device instance
21620  Returns:
21621  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21622  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21623  Remarks:
21624  None.
21625 */
21626 
21627 bool
21629  PORTS_MODULE_ID index ) ;
21630 //******************************************************************************
21631 /* Function:
21632  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
21633  Summary:
21634  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
21635  module.
21636  Description:
21637  This function identifies whether the ChangeNoticePerPortStatus feature is
21638  available on the Ports module.
21639  When this function returns true, these functions are supported on the device:
21640  - PLIB_PORTS_ChangeNoticePerPortHasOccured
21641  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
21642  Preconditions:
21643  None.
21644  Parameters:
21645  index - Identifier for the device instance
21646  Returns:
21647  - true - The ChangeNoticePerPortStatus feature is supported on the device
21648  - false - The ChangeNoticePerPortStatus feature is not supported on the device
21649  Remarks:
21650  None.
21651 */
21652 
21653 bool
21655  PORTS_MODULE_ID index ) ;
21656 //******************************************************************************
21657 /* Function:
21658  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
21659  Summary:
21660  Identifies whether the SlewRateControl feature exists on the Ports module.
21661  Description:
21662  This function identifies whether the SlewRateControl feature is available
21663  on the Ports module.
21664  When this function returns true, these functions are supported on the device:
21665  - PLIB_PORTS_ChannelSlewRateSelect
21666  - PLIB_PORTS_PinSlewRateGet
21667  Preconditions:
21668  None.
21669  Parameters:
21670  index - Identifier for the device instance
21671  Returns:
21672  - true - The SlewRateControl feature is supported on the device
21673  - false - The SlewRateControl feature is not supported on the device
21674  Remarks:
21675  None.
21676 */
21677 
21678 bool
21680  PORTS_MODULE_ID index ) ;
21681 //******************************************************************************
21682 /* Function:
21683  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
21684  Summary:
21685  Identifies whether the ChannelChangeNoticeMethod feature exists on the
21686  Ports module.
21687  Description:
21688  This function identifies whether the ChannelChangeNoticeMethod feature is
21689  available on the Ports module.
21690  When this function returns true, these functions are supported on the device:
21691  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
21692  - PLIB_PORTS_ChannelChangeNoticeMethodGet
21693  Preconditions:
21694  None.
21695  Parameters:
21696  index - Identifier for the device instance
21697  Returns:
21698  - true - The ChannelChangeNoticeMethod feature is supported on the device
21699  - false - The ChannelChangeNoticeMethod feature is not supported on the device
21700  Remarks:
21701  None.
21702 */
21703 
21704 bool
21706  PORTS_MODULE_ID index ) ;
21707 //******************************************************************************
21708 /* Function:
21709  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
21710  Summary:
21711  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
21712  module.
21713  Description:
21714  This function identifies whether the ChangeNoticeEdgeControl feature is
21715  available on the Ports module.
21716  When this function returns true, these functions are supported on the device:
21717  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21718  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21719  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21720  Preconditions:
21721  None.
21722  Parameters:
21723  index - Identifier for the device instance
21724  Returns:
21725  - true - The ChangeNoticeEdgeControl feature is supported on the device
21726  - false - The ChangeNoticeEdgeControl feature is not supported on the device
21727  Remarks:
21728  None.
21729 */
21730 
21731 bool
21733  PORTS_MODULE_ID index ) ;
21734 //******************************************************************************
21735 /* Function:
21736  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
21737  Summary:
21738  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
21739  module.
21740  Description:
21741  This function identifies whether the ChangeNoticeEdgeStatus feature is available
21742  on the Ports module.
21743  When this function returns true, this function is supported on the device:
21744  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21745  Preconditions:
21746  None.
21747  Parameters:
21748  index - Identifier for the device instance
21749  Returns:
21750  - true - The ChangeNoticeEdgeStatus feature is supported on the device
21751  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
21752  Remarks:
21753  None.
21754 */
21755 
21756 bool
21758  PORTS_MODULE_ID index ) ;
21759 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
21760 /*******************************************************************************
21761  Ports Peripheral Library Compatibility Header
21762  Company:
21763  Microchip Technology Inc.
21764  File Name:
21765  plib_ports_compatibility.h
21766  Summary:
21767  Ports Peripheral Library Interface header for backward compatibility.
21768  Description:
21769  This header file contains the definitions of the functions which are
21770  supported for backward compatibility only. These will be deprecated later.
21771 *******************************************************************************/
21772 // DOM-IGNORE-BEGIN
21773 /*******************************************************************************
21774 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
21775 Microchip licenses to you the right to use, modify, copy and distribute
21776 Software only when embedded on a Microchip microcontroller or digital signal
21777 controller that is integrated into your product or third party product
21778 (pursuant to the sublicense terms in the accompanying license agreement).
21779 You should refer to the license agreement accompanying this Software for
21780 additional information regarding your rights and obligations.
21781 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
21782 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
21783 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
21784 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
21785 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
21786 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
21787 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
21788 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
21789 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
21790 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
21791 *******************************************************************************/
21792 // DOM-IGNORE-END
21793 #ifndef _PLIB_PORTS_COMPATIBILITY_H
21794 #define _PLIB_PORTS_COMPATIBILITY_H
21795 #include <stdint.h>
21796 #include <stddef.h>
21797 // *****************************************************************************
21798 /* Function:
21799  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
21800  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
21801  Summary:
21802  checks the status of change on the pin
21803  Description:
21804  This function checks if the change has occurred on the given pin or not.
21805  Precondition:
21806  None.
21807  Parameters:
21808  index - Identifier for the device instance to be configured
21809  channel - Port pin channel
21810  bitPos - Position in the PORT pins
21811  Returns:
21812  None.
21813  Example:
21814  <code>
21815 
21816  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
21817  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
21818  {
21819  //do something
21820  }
21821 
21822  </code>
21823  Remarks:
21824  This feature may not be available on all devices. Please refer to the
21825  specific device data sheet to determine availability or use
21826  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
21827  whether this feature is available.
21828 
21829  This function will be deprecated later.
21830 */
21831 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
21832  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
21833 /*******************************************************************************
21834  End of File
21835 */
21836 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
21837 /* CLOSE_FILE Include File */
21838 
21839 //DOM-IGNORE-BEGIN
21840 //DOM-IGNORE-END
21841  // #ifndef _PLIB_PORTS_H
21842 /*******************************************************************************
21843  End of File
21844 */
21845 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
21846 /* CLOSE_FILE Include File */
21847 
21848 #include "system/int/sys_int.h"
21849 // *****************************************************************************
21850 // *****************************************************************************
21851 // Section: SYS PORTS Data Types
21852 // *****************************************************************************
21853 // *****************************************************************************
21854 // *****************************************************************************
21855 /* SYS PORTS PULLUP status
21856  Summary:
21857  Provides the pull-up and pull-down status.
21858  Description:
21859  These constants provide the pull-up or pull-down status definitions.
21860  Remarks:
21861  None.
21862 */
21863 
21864 typedef
21865  enum
21866  {
21867  /* PULLUP Disable */
21869  /*DOM-IGNORE-BEGIN*/
21870  = 0 /*DOM-IGNORE-END*/
21871  ,
21872  /* PULLUP Enable */
21874  /*DOM-IGNORE-BEGIN*/
21875  = 1 /*DOM-IGNORE-END*/
21876  ,
21878 // *****************************************************************************
21879 /* SYS PORTS PIN DIRECTION
21880  Summary:
21881  Defines the direction of the port pins.
21882  Description:
21883  These constants provide the port pin direction definitions.
21884  Remarks:
21885  None.
21886 */
21887 
21888 typedef
21889  enum
21890  {
21891  /* Direction as output */
21893  /*DOM-IGNORE-BEGIN*/
21894  = 0 /*DOM-IGNORE-END*/
21895  ,
21896  /* Direction as input */
21898  /*DOM-IGNORE-BEGIN*/
21899  = 1 /*DOM-IGNORE-END*/
21900  ,
21902 
21903 typedef
21904  enum
21905  {
21908  // #ifndef _SYS_PORTS_DEFINITIONS_H
21909 /*******************************************************************************
21910  End of File
21911 */
21912 
21913 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
21914 /* CLOSE_FILE Include File */
21915 
21916 // DOM-IGNORE-BEGIN
21917 // DOM-IGNORE-END
21918 // *****************************************************************************
21919 // *****************************************************************************
21920 // Section: SYS PorTS Module Initialization Routine
21921 // *****************************************************************************
21922 // *****************************************************************************
21923 // *****************************************************************************
21924 /* Function:
21925  void SYS_PORTS_Initialize()
21926  Summary:
21927  Initializes PORT Pins/Channels.
21928  <p><b>Implementation:</b> Static/Dynamic</p>
21929  Description:
21930  This function initializes different port pins/channels to the desired state.
21931  It also remaps the pins to the desired specific function.
21932  Precondition:
21933  None.
21934  Parameters:
21935  None.
21936  Returns:
21937  None.
21938  Example:
21939  <code>
21940  SYS_PORTS_Initialize();
21941  </code>
21942  Remarks:
21943  This API must be be called at the time of system initialization to
21944  initialize the ports pins.
21945 */
21946 
21947 void
21949 // *****************************************************************************
21950 // *****************************************************************************
21951 // Section: SYS PORTS CONTROL Routines
21952 // *****************************************************************************
21953 // *****************************************************************************
21954 // *****************************************************************************
21955 /* Function:
21956  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21957  Summary:
21958  Reads the data from the I/O port.
21959  <p><b>Implementation:</b> Dynamic</p>
21960  Description:
21961  This function reads the data from the I/O port.
21962  Preconditions:
21963  The direction of the port to be set as input.
21964  Parameters:
21965  index - Identifier for the device instance to be configured
21966  channel - Identifier for the PORT channel: A, B, C, etc.
21967  Returns:
21968  Returns the data read from the port.
21969  Example:
21970  <code>
21971  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21972  // application developer.
21973  PORTS_DATA_TYPE readData;
21974  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
21975  </code>
21976  Remarks:
21977  None.
21978 */
21979 
21981  SYS_PORTS_Read (
21982  PORTS_MODULE_ID index ,
21983  PORTS_CHANNEL channel ) ;
21984 // *****************************************************************************
21985 /* Function:
21986  void SYS_PORTS_Write( PORTS_MODULE_ID index,
21987  PORTS_CHANNEL channel,
21988  PORTS_DATA_TYPE value )
21989  Summary:
21990  Writes the data to the I/O port.
21991  <p><b>Implementation:</b> Dynamic</p>
21992  Description:
21993  This function writes the data to the I/O port.
21994  Preconditions:
21995  The direction of the port to be set as output.
21996  Parameters:
21997  index - Identifier for the device instance to be configured
21998  channel - Identifier for the PORT channel: A, B, C, etc.
21999  value - Value to be written into a port of width PORTS_DATA_TYPE
22000  Returns:
22001  None.
22002  Example:
22003  <code>
22004  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22005  // application developer.
22006  PORTS_DATA_TYPE writeData;
22007  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
22008  </code>
22009  Remarks:
22010  None.
22011 */
22012 
22013 void
22014  SYS_PORTS_Write (
22015  PORTS_MODULE_ID index ,
22016  PORTS_CHANNEL channel ,
22017  PORTS_DATA_TYPE value ) ;
22018 // *****************************************************************************
22019 /* Function:
22020  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22021  Summary:
22022  Reads the data driven on the I/O port.
22023  <p><b>Implementation:</b> Dynamic</p>
22024  Description:
22025  This function reads the data driven on the I/O port.
22026  Preconditions:
22027  The direction of the port to be set as output.
22028  Parameters:
22029  index - Identifier for the device instance to be configured
22030  channel - Identifier for the PORT channel: A, B, C, etc.
22031  Returns:
22032  Returns the data driven on the port.
22033  Example:
22034  <code>
22035  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22036  // application developer.
22037  PORTS_DATA_TYPE drivenData;
22038  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22039  </code>
22040  Remarks:
22041  None.
22042 */
22043 
22046  PORTS_MODULE_ID index ,
22047  PORTS_CHANNEL channel ) ;
22048 // *****************************************************************************
22049 /* Function:
22050  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22051  PORTS_DATA_TYPE value,
22052  PORTS_DATA_MASK mask )
22053  Summary:
22054  Sets the selected digital port/latch based on the mask.
22055  <p><b>Implementation:</b> Dynamic</p>
22056  Description:
22057  This function Sets the selected digital port/latch relative to the mask.
22058  This function "AND" value and mask parameters and then set the bits
22059  in the port channel that were set in the result of the ANDing operation.
22060  Preconditions:
22061  None.
22062  Parameters:
22063  index - Identifier for the device instance to be configured
22064  channel - Identifier for the PORT channel: A, B, C, etc.
22065  value - Consists of information about which port bit has to be set
22066  mask - Identifies the bits which could be intended for setting
22067  Returns:
22068  None.
22069  Example:
22070  <code>
22071  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22072  // application developer.
22073  // MY_VALUE - 0x1234
22074  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22075  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
22076  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
22077  </code>
22078  Remarks:
22079  Not all features are available on all devices. Refer to the specific device
22080  data sheet for availability.
22081 */
22082 
22083 void
22084  SYS_PORTS_Set (
22085  PORTS_MODULE_ID index ,
22086  PORTS_CHANNEL channel ,
22087  PORTS_DATA_TYPE value ,
22088  PORTS_DATA_MASK mask ) ;
22089 // *****************************************************************************
22090 /* Function:
22091  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22092  PORTS_DATA_MASK clearMask )
22093  Summary:
22094  Clears the selected digital port.
22095  <p><b>Implementation:</b> Dynamic</p>
22096  Description:
22097  This function clears the selected digital port.
22098  Preconditions:
22099  None.
22100  Parameters:
22101  index - Identifier for the device instance to be configured
22102  channel - Identifier for the PORT channel: A, B, C, etc.
22103  clearMask - Identifies the bits to be cleared
22104  Returns:
22105  None.
22106  Example:
22107  <code>
22108  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22109  // application developer.
22110  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22111  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22112  </code>
22113  Remarks:
22114  Not all features are available on all devices. Refer to the specific device
22115  data sheet for availability.
22116 */
22117 
22118 void
22119  SYS_PORTS_Clear (
22120  PORTS_MODULE_ID index ,
22121  PORTS_CHANNEL channel ,
22122  PORTS_DATA_MASK clearMask ) ;
22123 // *****************************************************************************
22124 /* Function:
22125  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22126  SYS_PORTS_PIN_DIRECTION pinDir,
22127  PORTS_CHANNEL channel,
22128  PORTS_DATA_MASK mask )
22129  Summary:
22130  Enables the direction for the selected port.
22131  <p><b>Implementation:</b> Dynamic</p>
22132  Description:
22133  This function enables the direction for the selected port.
22134  Preconditions:
22135  None.
22136  Parameters:
22137  index - Identifier for the device instance to be configured
22138  pinDir - Pin direction
22139  channel - Identifier for the PORT channel: A, B, C, etc.
22140  mask - Mask for the direction of width PORTS_DATA_MASK
22141  Returns:
22142  None
22143  Example:
22144  <code>
22145  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22146  // application developer.
22147  SYS_PORTS_PIN_DIRECTION pinDir;
22148  pinDir = SYS_PORTS_DIRECTION_INPUT;
22149  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22150  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22151  </code>
22152  Remarks:
22153  None.
22154 */
22155 
22156 void
22158  PORTS_MODULE_ID index ,
22159  SYS_PORTS_PIN_DIRECTION pinDir ,
22160  PORTS_CHANNEL channel ,
22161  PORTS_DATA_MASK mask ) ;
22162 // *****************************************************************************
22163 /* Function:
22164  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22165  Summary:
22166  Reads the direction for the selected port.
22167  <p><b>Implementation:</b> Dynamic</p>
22168  Description:
22169  This function reads the direction for the selected port.
22170  Preconditions:
22171  None.
22172  Parameters:
22173  index - Identifier for the device instance to be configured
22174  channel - Identifier for the PORT channel: A, B, C, etc.
22175  Returns:
22176  Direction of the port.
22177  Example:
22178  <code>
22179  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22180  // application developer.
22181  PORTS_DATA_MASK value;
22182  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22183  </code>
22184  Remarks:
22185  None.
22186 */
22187 
22190  PORTS_MODULE_ID index ,
22191  PORTS_CHANNEL channel ) ;
22192 // *****************************************************************************
22193 /* Function:
22194  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22195  PORTS_DATA_MASK toggleMask )
22196  Summary:
22197  Toggles the selected digital port pins.
22198  <p><b>Implementation:</b> Dynamic</p>
22199  Description:
22200  This function toggles the selected digital port pins.
22201  Preconditions:
22202  None.
22203  Parameters:
22204  index - Identifier for the device instance to be configured
22205  channel - Identifier for the PORT channel: A, B, C, etc.
22206  toggleMask - Identifies the bits to be toggled
22207  Returns:
22208  None.
22209  Example:
22210  <code>
22211  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22212  // application developer.
22213  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22214  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22215  </code>
22216  Remarks:
22217  None.
22218 */
22219 
22220 void
22222  PORTS_MODULE_ID index ,
22223  PORTS_CHANNEL channel ,
22224  PORTS_DATA_MASK toggleMask ) ;
22225 // *****************************************************************************
22226 /* Function:
22227  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22228  PORTS_DATA_MASK mask )
22229  Summary:
22230  Enables the open-drain functionality for the selected port.
22231  <p><b>Implementation:</b> Dynamic</p>
22232  Description:
22233  This function enables the open-drain functionality for the selected port.
22234  Preconditions:
22235  None.
22236  Parameters:
22237  index - Identifier for the device instance to be configured
22238  channel - Identifier for the PORT channel: A, B, C, etc.
22239  mask - Mask of type PORTS_DATA_MASK
22240  Returns:
22241  None.
22242  Example:
22243  <code>
22244  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22245  // application developer.
22246  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22247  </code>
22248  Remarks:
22249  Not all features are available on all devices. Refer to the specific device
22250  data sheet for availability.
22251 */
22252 
22253 void
22255  PORTS_MODULE_ID index ,
22256  PORTS_CHANNEL channel ,
22257  PORTS_DATA_MASK mask ) ;
22258 // *****************************************************************************
22259 /* Function:
22260  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22261  PORTS_DATA_MASK mask )
22262  Summary:
22263  Disables the open-drain functionality for the selected port.
22264  <p><b>Implementation:</b> Dynamic</p>
22265  Description:
22266  This function disables the open-drain functionality for the selected port.
22267  Preconditions:
22268  None.
22269  Parameters:
22270  index - Identifier for the device instance to be configured
22271  channel - Identifier for the PORT channel: A, B, C, etc.
22272  mask - Mask of type PORTS_DATA_MASK
22273  Returns:
22274  None.
22275  Example:
22276  <code>
22277  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22278  // application developer.
22279  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22280  </code>
22281  Remarks:
22282  Not all features are available on all devices. Refer to the specific device
22283  data sheet for availability.
22284 */
22285 
22286 void
22288  PORTS_MODULE_ID index ,
22289  PORTS_CHANNEL channel ,
22290  PORTS_DATA_MASK mask ) ;
22291 // *****************************************************************************
22292 /* Function:
22293  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22294  (
22295  PORTS_MODULE_ID index,
22296  PORTS_CHANNEL channel
22297  )
22298  Summary:
22299  Reads the interrupt status from the I/O port.
22300  <p><b>Implementation:</b> Dynamic</p>
22301  Description:
22302  This function reads the interrupt status from the I/O port.
22303  Preconditions:
22304  The interrupts should have been configured.
22305  Parameters:
22306  index - Identifier for the device instance to be configured
22307  channel - Identifier for the PORT channel: A, B, C, etc.
22308  Returns:
22309  Returns the interrupt status of the port channel.
22310  Example:
22311  <code>
22312  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22313  // application developer.
22314  PORTS_DATA_TYPE channelStatus;
22315  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22316  </code>
22317  Remarks:
22318  None.
22319 */
22320 
22323  PORTS_MODULE_ID index ,
22324  PORTS_CHANNEL channel ) ;
22325 // *****************************************************************************
22326 // *****************************************************************************
22327 // Section: SYS PORT PINS REMAPING Routines
22328 // *****************************************************************************
22329 // *****************************************************************************
22330 // *****************************************************************************
22331 /* Function:
22332  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22333  PORTS_REMAP_INPUT_FUNCTION function,
22334  PORTS_REMAP_INPUT_PIN remapPin )
22335  Summary:
22336  Input/Output (I/O) function remapping.
22337  <p><b>Implementation:</b> Dynamic</p>
22338  Description:
22339  This function controls the I/O function remapping.
22340  Precondition:
22341  None.
22342  Parameters:
22343  index - Identifier for the device instance to be configured
22344  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22345  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22346  Returns:
22347  None.
22348  Example:
22349  <code>
22350  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22351  // application developer.
22352  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22353  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22354  </code>
22355  Remarks:
22356  This feature may not be available on all devices. Please refer to the
22357  specific device data sheet to determine availability or use
22358  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22359  this feature is available.
22360 */
22361 
22362 void
22364  PORTS_MODULE_ID index ,
22365  PORTS_REMAP_INPUT_FUNCTION function ,
22366  PORTS_REMAP_INPUT_PIN remapPin ) ;
22367 // *****************************************************************************
22368 /* Function:
22369  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22370  PORTS_REMAP_OUTPUT_FUNCTION function,
22371  PORTS_REMAP_OUTPUT_PIN remapPin )
22372  Summary:
22373  Input/Output (I/O) function remapping.
22374  <p><b>Implementation:</b> Dynamic</p>
22375  Description:
22376  This function controls the I/O function remapping.
22377  Precondition:
22378  None.
22379  Parameters:
22380  index - Identifier for the device instance to be configured
22381  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22382  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22383  Returns:
22384  None.
22385  Example:
22386  <code>
22387  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22388  // application developer.
22389  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22390  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22391  </code>
22392  Remarks:
22393  This feature may not be available on all devices. Please refer to the
22394  specific device data sheet to determine availability or use
22395  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22396  this feature is available.
22397 */
22398 
22399 void
22401  PORTS_MODULE_ID index ,
22402  PORTS_REMAP_OUTPUT_FUNCTION function ,
22403  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22404 // *****************************************************************************
22405 // *****************************************************************************
22406 // Section: SYS Change Notification Pins Routines
22407 // *****************************************************************************
22408 // *****************************************************************************
22409 // *****************************************************************************
22410 /* Function:
22411  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22412  Summary:
22413  Globally enables the change notification for the selected port.
22414  <p><b>Implementation:</b> Dynamic</p>
22415  Description:
22416  This function globally enables the change notification for the selected port.
22417  Preconditions:
22418  None.
22419  Parameters:
22420  None.
22421  Returns:
22422  None.
22423  Example:
22424  <code>
22425  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22426  // application developer.
22427  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22428  </code>
22429  Remarks:
22430  Not all features are available on all devices. Refer to the specific device
22431  data sheet for availability.
22432 */
22433 
22434 void
22436  PORTS_MODULE_ID index ) ;
22437 // *****************************************************************************
22438 /* Function:
22439  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22440  Summary:
22441  Globally disables the change notification for the selected port.
22442  <p><b>Implementation:</b> Dynamic</p>
22443  Description:
22444  This function globally disables the change notification for the selected port.
22445  Preconditions:
22446  None.
22447  Parameters:
22448  None.
22449  Returns:
22450  None.
22451  Example:
22452  <code>
22453  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22454  // application developer.
22455  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22456  </code>
22457  Remarks:
22458  Not all features are available on all devices. Refer to the specific device
22459  data sheet for availability.
22460 */
22461 
22462 void
22464  PORTS_MODULE_ID index ) ;
22465 // *****************************************************************************
22466 /* Function:
22467  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22468  PORTS_CHANGE_NOTICE_PIN pinNum,
22469  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22470  Summary:
22471  Enables the change notification for the selected port.
22472  <p><b>Implementation:</b> Dynamic</p>
22473  Description:
22474  This function enables the change notification for the selected port.
22475  Preconditions:
22476  None.
22477  Parameters:
22478  index - Identifier for the device instance to be configured
22479  value - Pull-up enable or disable value
22480  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22481  Returns:
22482  None.
22483  Example:
22484  <code>
22485  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22486  // application developer.
22487  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22488  PORTS_CHANGE_NOTICE_PIN pinNum;
22489  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22490  </code>
22491  Remarks:
22492  Not all features are available on all devices. Refer to the specific device
22493  data sheet for availability.
22494 */
22495 
22496 void
22498  PORTS_MODULE_ID index ,
22499  PORTS_CHANGE_NOTICE_PIN pinNum ,
22501 // *****************************************************************************
22502 /* Function:
22503  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22504  PORTS_CHANGE_NOTICE_PIN pinNum )
22505  Summary:
22506  Disables the change notification for the selected port.
22507  <p><b>Implementation:</b> Dynamic</p>
22508  Description:
22509  This function disables the change notification for the selected port.
22510  Preconditions:
22511  None.
22512  Parameters:
22513  index - Identifier for the device instance to be configured
22514  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22515  Returns:
22516  None.
22517  Example:
22518  <code>
22519  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22520  // application developer.
22521  PORTS_CHANGE_NOTICE_PIN pinNum;
22522  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22523  </code>
22524  Remarks:
22525  Not all features are available on all devices. Refer to the specific device
22526  data sheet for availability.
22527 */
22528 
22529 void
22531  PORTS_MODULE_ID index ,
22532  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22533 // *****************************************************************************
22534 /* Function:
22535  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22536  Summary:
22537  Enables the change notification for the selected port in Sleep or Idle mode.
22538  <p><b>Implementation:</b> Dynamic</p>
22539  Description:
22540  This function enables the change notification for the selected port in Sleep
22541  or Idle mode.
22542  Preconditions:
22543  None.
22544  Parameters:
22545  None.
22546  Returns:
22547  None.
22548  Example:
22549  <code>
22550  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22551  // application developer.
22552  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22553  </code>
22554  Remarks:
22555  Not all features are available on all devices. Refer to the specific device
22556  data sheet for availability.
22557 */
22558 
22559 void
22561  PORTS_MODULE_ID index ) ;
22562 // *****************************************************************************
22563 /* Function:
22564  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22565  Summary:
22566  Disables the change notification for the selected port in Sleep or Idle mode.
22567  <p><b>Implementation:</b> Dynamic</p>
22568  Description:
22569  This function disables the change notification for the selected port in Sleep
22570  or Idle mode.
22571  Preconditions:
22572  None.
22573  Parameters:
22574  None.
22575  Returns:
22576  None.
22577  Example:
22578  <code>
22579  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22580  // application developer.
22581  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22582  </code>
22583  Remarks:
22584  Not all features are available on all devices. Refer to the specific device
22585  data sheet for availability.
22586 */
22587 
22588 void
22590  PORTS_MODULE_ID index ) ;
22591 // *****************************************************************************
22592 /* Function:
22593  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22594  PORTS_CHANGE_NOTICE_PIN pinNum )
22595  Summary:
22596  Enables a weak pull-up on the change notification pin.
22597  <p><b>Implementation:</b> Dynamic</p>
22598  Description:
22599  This function enables a weak pull-up on the change notification pin.
22600  Preconditions:
22601  None.
22602  Parameters:
22603  index - Identifier for the device instance to be configured
22604  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22605  Returns:
22606  None.
22607  Example:
22608  <code>
22609  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22610  // application developer.
22611  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22612  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22613  </code>
22614  Remarks:
22615  Not all features are available on all devices. Refer to the specific device
22616  data sheet for availability.
22617 */
22618 
22619 void
22621  PORTS_MODULE_ID index ,
22622  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22623 // *****************************************************************************
22624 /* Function:
22625  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22626  PORTS_CHANGE_NOTICE_PIN pinNum )
22627  Summary:
22628  Disables a weak pull-up on the change notification pin.
22629  <p><b>Implementation:</b> Dynamic</p>
22630  Description:
22631  This function Disables a weak pull-up on the change notification pin.
22632  Preconditions:
22633  None.
22634  Parameters:
22635  index - Identifier for the device instance to be configured
22636  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22637  Returns:
22638  None.
22639  Example:
22640  <code>
22641  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22642  // application developer.
22643  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22644  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
22645  </code>
22646  Remarks:
22647  Not all features are available on all devices. Refer to the specific device
22648  data sheet for availability.
22649 */
22650 
22651 void
22653  PORTS_MODULE_ID index ,
22654  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22655 // *****************************************************************************
22656 // *****************************************************************************
22657 // Section: SYS PORT PINS Control Routines
22658 // *****************************************************************************
22659 // *****************************************************************************
22660 // *****************************************************************************
22661 /* Function:
22662  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
22663  PORTS_ANALOG_PIN pin,
22664  PORTS_PIN_MODE mode)
22665  Summary:
22666  Enables the selected pin as analog or digital.
22667  <p><b>Implementation:</b> Dynamic</p>
22668  Description:
22669  This function enables the selected pin as analog or digital.
22670  Preconditions:
22671  None.
22672  Parameters:
22673  index - Identifier for the device instance to be configured
22674  pin - Possible values of PORTS_ANALOG_PIN
22675  mode - Possible values of PORTS_PIN_MODE
22676  Returns:
22677  None.
22678  Example:
22679  <code>
22680  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22681  // application developer.
22682  // MY_PIN - PORTS_ANALOG_PIN_AN0
22683  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
22684  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
22685  </code>
22686  Remarks:
22687  Not all features are available on all devices. Refer to the specific device
22688  data sheet for availability.
22689 */
22690 
22691 void
22693  PORTS_MODULE_ID index ,
22694  PORTS_ANALOG_PIN pin ,
22695  PORTS_PIN_MODE mode ) ;
22696 // *****************************************************************************
22697 /* Function:
22698  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
22699  PORTS_CHANNEL channel,
22700  PORTS_BIT_POS bitPos
22701  bool value )
22702  Summary:
22703  Writes the selected digital pin.
22704  <p><b>Implementation:</b> Dynamic</p>
22705  Description:
22706  This function writes the selected digital pin.
22707  Preconditions:
22708  None.
22709  Parameters:
22710  index - Identifier for the device instance to be configured
22711  channel - Identifier for the PORT channel: A, B, C, etc.
22712  bitPos - Possible values of PORTS_BIT_POS
22713  value - Value to be written to the specific pin/latch:
22714  - true - Sets the bit
22715  - false - Clears the bit
22716  Returns:
22717  None.
22718  Example:
22719  <code>
22720  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22721  // application developer.
22722  // MY_PINNUM - PORTS_PIN_10
22723  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
22724  </code>
22725  Remarks:
22726  Not all features are available on all devices. Refer to the specific device
22727  data sheet for availability.
22728 */
22729 
22730 void
22732  PORTS_MODULE_ID index ,
22733  PORTS_CHANNEL channel ,
22734  PORTS_BIT_POS bitPos ,
22735  bool value ) ;
22736 // *****************************************************************************
22737 /* Function:
22738  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
22739  PORTS_CHANNEL channel,
22740  PORTS_BIT_POS bitPos )
22741  Summary:
22742  Reads the data driven on the selected digital pin.
22743  <p><b>Implementation:</b> Dynamic</p>
22744  Description:
22745  This function reads the data driven on the selected
22746  digital output pin.
22747  Preconditions:
22748  None.
22749  Parameters:
22750  index - Identifier for the device instance to be configured
22751  channel - Identifier for the PORT channel: A, B, C, etc.
22752  bitPos - Possible values of PORTS_BIT_POS
22753  Returns:
22754  The status of the data driven on the port pin.
22755  Example:
22756  <code>
22757  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22758  // application developer.
22759  // MY_PINNUM - PORTS_PIN_10
22760  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22761  </code>
22762  Remarks:
22763  Not all features are available on all devices. Refer to the specific device
22764  data sheet for availability.
22765 */
22766 
22767 bool
22769  PORTS_MODULE_ID index ,
22770  PORTS_CHANNEL channel ,
22771  PORTS_BIT_POS bitPos ) ;
22772 // *****************************************************************************
22773 /* Function:
22774  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
22775  PORTS_CHANNEL channel,
22776  PORTS_BIT_POS bitPos )
22777  Summary:
22778  Reads the selected digital pin.
22779  <p><b>Implementation:</b> Dynamic</p>
22780  Description:
22781  This function reads the selected digital pin, not the Latch.
22782  Preconditions:
22783  None.
22784  Parameters:
22785  index - Identifier for the device instance to be configured
22786  channel - Identifier for the PORT channel: A, B, C, etc.
22787  bitPos - Possible values of PORTS_BIT_POS
22788  Returns:
22789  The status of the port pin.
22790  Example:
22791  <code>
22792  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22793  // application developer.
22794  // MY_PINNUM - PORTS_PIN_10
22795  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22796  </code>
22797  Remarks:
22798  Not all features are available on all devices. Refer to the specific device
22799  data sheet for availability.
22800 */
22801 
22802 bool
22804  PORTS_MODULE_ID index ,
22805  PORTS_CHANNEL channel ,
22806  PORTS_BIT_POS bitPos ) ;
22807 // *****************************************************************************
22808 /* Function:
22809  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
22810  PORTS_CHANNEL channel,
22811  PORTS_BIT_POS bitPos )
22812  Summary:
22813  Toggles the selected digital pin.
22814  <p><b>Implementation:</b> Dynamic</p>
22815  Description:
22816  This function toggles the selected digital pin.
22817  Preconditions:
22818  None.
22819  Parameters:
22820  index - Identifier for the device instance to be configured
22821  channel - Identifier for the PORT channel: A, B, C, etc.
22822  bitPos - Possible values of PORTS_BIT_POS
22823  Returns:
22824  None.
22825  Example:
22826  <code>
22827  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22828  // application developer.
22829  // MY_PINNUM - PORTS_PIN_10
22830  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22831  </code>
22832  Remarks:
22833  Not all features are available on all devices. Refer to the specific device
22834  data sheet for availability.
22835 */
22836 
22837 void
22839  PORTS_MODULE_ID index ,
22840  PORTS_CHANNEL channel ,
22841  PORTS_BIT_POS bitPos ) ;
22842 // *****************************************************************************
22843 /* Function:
22844  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
22845  PORTS_CHANNEL channel,
22846  PORTS_BIT_POS bitPos )
22847  Summary:
22848  Sets the selected digital pin/latch.
22849  <p><b>Implementation:</b> Dynamic</p>
22850  Description:
22851  This function sets the selected digital pin/latch.
22852  Preconditions:
22853  None.
22854  Parameters:
22855  index - Identifier for the device instance to be configured
22856  channel - Identifier for the PORT channel: A, B, C, etc.
22857  bitPos - Possible values of PORTS_BIT_POS
22858  Returns:
22859  None.
22860  Example:
22861  <code>
22862  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22863  // application developer.
22864  // MY_PINNUM - PORTS_PIN_10
22865  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22866  </code>
22867  Remarks:
22868  Not all features are available on all devices. Refer to the specific device
22869  data sheet for availability.
22870 */
22871 
22872 void
22874  PORTS_MODULE_ID index ,
22875  PORTS_CHANNEL channel ,
22876  PORTS_BIT_POS bitPos ) ;
22877 // *****************************************************************************
22878 /* Function:
22879  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
22880  PORTS_CHANNEL channel,
22881  PORTS_BIT_POS bitPos )
22882  Summary:
22883  Clears the selected digital pin.
22884  <p><b>Implementation:</b> Dynamic</p>
22885  Description:
22886  This function clears the selected digital pin.
22887  Preconditions:
22888  None.
22889  Parameters:
22890  index - Identifier for the device instance to be configured
22891  channel - Identifier for the PORT channel: A, B, C, etc.
22892  bitPos - Possible values of PORTS_BIT_POS
22893  Returns:
22894  None.
22895  Example:
22896  <code>
22897  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22898  // application developer.
22899  // MY_PINNUM - PORTS_IO_PIN_10
22900  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22901  </code>
22902  Remarks:
22903  Not all features are available on all devices. Refer to the specific device
22904  data sheet for availability.
22905 */
22906 
22907 void
22909  PORTS_MODULE_ID index ,
22910  PORTS_CHANNEL channel ,
22911  PORTS_BIT_POS bitPos ) ;
22912 // *****************************************************************************
22913 /* Function:
22914  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
22915  SYS_PORTS_PIN_DIRECTION pinDir,
22916  PORTS_CHANNEL channel,
22917  PORTS_BIT_POS bitPos )
22918  Summary:
22919  Enables the direction for the selected pin.
22920  <p><b>Implementation:</b> Dynamic</p>
22921  Description:
22922  This function enables the direction for the selected pin.
22923  Preconditions:
22924  None.
22925  Parameters:
22926  index - Identifier for the device instance to be configured
22927  pinDir - Pin direction
22928  channel - Identifier for the PORT channel: A, B, C, etc.
22929  bitPos - Possible values of PORTS_BIT_POS
22930  Returns:
22931  None.
22932  Example:
22933  <code>
22934  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22935  // application developer.
22936  // MY_PINNUM - PORTS_PIN_10
22937  SYS_PORTS_PIN_DIRECTION pinDir;
22938  pinDir = SYS_PORTS_DIRECTION_INPUT;
22939  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
22940  </code>
22941  Remarks:
22942  Not all features are available on all devices. Refer to the specific device
22943  data sheet for availability.
22944 */
22945 
22946 void
22948  PORTS_MODULE_ID index ,
22949  SYS_PORTS_PIN_DIRECTION pinDir ,
22950  PORTS_CHANNEL channel ,
22951  PORTS_BIT_POS bitPos ) ;
22952 // *****************************************************************************
22953 /* Function:
22954  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
22955  PORTS_CHANNEL channel,
22956  PORTS_BIT_POS bitPos )
22957  Summary:
22958  Enables the open-drain functionality for the selected pin.
22959  <p><b>Implementation:</b> Dynamic</p>
22960  Description:
22961  This function enables the open-drain functionality for the selected pin.
22962  Preconditions:
22963  None.
22964  Parameters:
22965  index - Identifier for the device instance to be configured
22966  channel - Identifier for the PORT channel: A, B, C, etc.
22967  bitPos - Possible values of PORTS_BIT_POS
22968  Returns:
22969  None.
22970  Example:
22971  <code>
22972  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22973  // application developer.
22974  // MY_PINNUM - PORTS_PIN_10
22975  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22976  </code>
22977  Remarks:
22978  Not all features are available on all devices. Refer to the specific device
22979  data sheet for availability.
22980 */
22981 
22982 void
22984  PORTS_MODULE_ID index ,
22985  PORTS_CHANNEL channel ,
22986  PORTS_BIT_POS bitPos ) ;
22987 // *****************************************************************************
22988 /* Function:
22989  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
22990  PORTS_CHANNEL channel,
22991  PORTS_BIT_POS bitPos )
22992  Summary:
22993  Disables the open-drain functionality for the selected pin.
22994  <p><b>Implementation:</b> Dynamic</p>
22995  Description:
22996  This function disables the open-drain functionality for the selected pin.
22997  Preconditions:
22998  None.
22999  Parameters:
23000  index - Identifier for the device instance to be configured
23001  channel - Identifier for the PORT channel: A, B, C, etc.
23002  bitPos - Possible values of PORTS_BIT_POS
23003  Returns:
23004  None.
23005  Example:
23006  <code>
23007  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23008  // application developer.
23009  // MY_PINNUM - PORTS_PIN_10
23010  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23011  </code>
23012  Remarks:
23013  Not all features are available on all devices. Refer to the specific device
23014  data sheet for availability.
23015 */
23016 
23017 void
23019  PORTS_MODULE_ID index ,
23020  PORTS_CHANNEL channel ,
23021  PORTS_BIT_POS bitPos ) ;
23022 // *****************************************************************************
23023 /* Function:
23024  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
23025  PORTS_CHANNEL channel,
23026  PORTS_BIT_POS bitPos )
23027  Summary:
23028  Enables the pull-up functionality for the selected pin.
23029  <p><b>Implementation:</b> Dynamic</p>
23030  Description:
23031  This function enables the pull-up functionality for the selected pin.
23032  Preconditions:
23033  None.
23034  Parameters:
23035  index - Identifier for the device instance to be configured
23036  channel - Identifier for the PORT channel: A, B, C, etc.
23037  bitPos - Possible values of PORTS_BIT_POS
23038  Returns:
23039  None.
23040  Example:
23041  <code>
23042  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23043  // application developer.
23044  // MY_PINNUM - PORTS_PIN_10
23045  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23046  </code>
23047  Remarks:
23048  Not all features are available on all devices. Refer to the specific device
23049  data sheet for availability.
23050 */
23051 
23052 void
23054  PORTS_MODULE_ID index ,
23055  PORTS_CHANNEL channel ,
23056  PORTS_BIT_POS bitPos ) ;
23057 // *****************************************************************************
23058 /* Function:
23059  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
23060  PORTS_CHANNEL channel,
23061  PORTS_BIT_POS bitPos )
23062  Summary:
23063  Disables the pull-up functionality for the selected pin.
23064  <p><b>Implementation:</b> Dynamic</p>
23065  Description:
23066  This function disables the pull-up functionality for the selected pin.
23067  Preconditions:
23068  None.
23069  Parameters:
23070  index - Identifier for the device instance to be configured
23071  channel - Identifier for the PORT channel: A, B, C, etc.
23072  bitPos - Possible values of PORTS_BIT_POS
23073  Returns:
23074  None.
23075  Example:
23076  <code>
23077  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23078  // application developer.
23079  // MY_PINNUM - PORTS_PIN_10
23080  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23081  </code>
23082  Remarks:
23083  Not all features are available on all devices. Refer to the specific device
23084  data sheet for availability.
23085 */
23086 
23087 void
23089  PORTS_MODULE_ID index ,
23090  PORTS_CHANNEL channel ,
23091  PORTS_BIT_POS bitPos ) ;
23092 // *****************************************************************************
23093 /* Function:
23094  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23095  PORTS_CHANNEL channel,
23096  PORTS_BIT_POS bitPos )
23097  Summary:
23098  Enables the pull-down functionality for the selected pin.
23099  <p><b>Implementation:</b> Dynamic</p>
23100  Description:
23101  This function enables the pull-down functionality for the selected pin.
23102  Preconditions:
23103  None.
23104  Parameters:
23105  index - Identifier for the device instance to be configured
23106  channel - Identifier for the PORT channel: A, B, C, etc.
23107  bitPos - Possible values of PORTS_BIT_POS
23108  Returns:
23109  None.
23110  Example:
23111  <code>
23112  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23113  // application developer.
23114  // MY_PINNUM - PORTS_PIN_10
23115  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23116  </code>
23117  Remarks:
23118  Not all features are available on all devices. Refer to the specific device
23119  data sheet for availability.
23120 */
23121 
23122 void
23124  PORTS_MODULE_ID index ,
23125  PORTS_CHANNEL channel ,
23126  PORTS_BIT_POS bitPos ) ;
23127 // *****************************************************************************
23128 /* Function:
23129  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23130  PORTS_CHANNEL channel,
23131  PORTS_BIT_POS bitPos )
23132  Summary:
23133  Disables the pull-down functionality for the selected pin.
23134  <p><b>Implementation:</b> Dynamic</p>
23135  Description:
23136  This function disables the pull-down functionality for the selected pin.
23137  Preconditions:
23138  None.
23139  Parameters:
23140  index - Identifier for the device instance to be configured
23141  channel - Identifier for the PORT channel: A, B, C, etc.
23142  bitPos - Possible values of PORTS_BIT_POS
23143  Returns:
23144  None.
23145  Example:
23146  <code>
23147  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23148  // application developer.
23149  // MY_PINNUM - PORTS_PIN_10
23150  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23151  </code>
23152  Remarks:
23153  Not all features are available on all devices. Refer to the specific device
23154  data sheet for availability.
23155 */
23156 
23157 void
23159  PORTS_MODULE_ID index ,
23160  PORTS_CHANNEL channel ,
23161  PORTS_BIT_POS bitPos ) ;
23162 //******************************************************************************
23163 /* Function:
23164  void SYS_PORTS_InterruptEnable
23165  (
23166  PORTS_MODULE_ID index,
23167  PORTS_CHANNEL channel,
23168  PORTS_BIT_POS bitPos,
23169  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23170  )
23171  Summary:
23172  Enables the selected interrupt for the selected port pin.
23173  Description:
23174  This function enables the selected interrupt for the selected port pin.
23175  Preconditions:
23176  Select the pull-up or pull-down as required.
23177  Parameters:
23178  index - Identifier for the device instance to be configured
23179  channel - Identifier for the PORT channel: A, B, C, etc.
23180  bitPos - Possible values of PORTS_BIT_POS
23181  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23182  Returns:
23183  None.
23184  Example:
23185  <code>
23186  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23187  </code>
23188  Remarks:
23189  None.
23190 */
23191 
23192 void
23194  PORTS_MODULE_ID index ,
23195  PORTS_CHANNEL channel ,
23196  PORTS_BIT_POS bitPos ,
23197  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23198 //DOM-IGNORE-BEGIN
23199 //DOM-IGNORE-END
23200  //SYS_PORTS_H
23201 /*******************************************************************************
23202  End of File
23203 */
23204 
23205 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23206 /* CLOSE_FILE Include File */
23207 
23208 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23209 /*******************************************************************************
23210  SPI Driver Interface
23211  Company:
23212  Microchip Technology Inc.
23213  File Name:
23214  drv_spi.h
23215  Summary:
23216  SPI device driver interface file.
23217  Description:
23218  The SPI driver provides a simple interface to manage the SPI module.
23219  This file defines the interface definitions and prototypes for the SPI driver.
23220 *******************************************************************************/
23221 //DOM-IGNORE-BEGIN
23222 /*******************************************************************************
23223 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23224 Microchip licenses to you the right to use, modify, copy and distribute
23225 Software only when embedded on a Microchip microcontroller or digital signal
23226 controller that is integrated into your product or third party product
23227 (pursuant to the sublicense terms in the accompanying license agreement).
23228 You should refer to the license agreement accompanying this Software for
23229 additional information regarding your rights and obligations.
23230 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23231 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23232 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23233 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23234 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23235 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23236 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23237 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23238 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23239 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23240 *******************************************************************************/
23241 //DOM-IGNORE-END
23242 #ifndef _DRV_SPI_H
23243 #define _DRV_SPI_H
23244 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23245 /*******************************************************************************
23246  SPI Driver Interface
23247  Company:
23248  Microchip Technology Inc.
23249  File Name:
23250  drv_spi_definitions.h
23251  Summary:
23252  SPI device driver interface file.
23253  Description:
23254  The SPI driver provides a simple interface to manage the SPI module.
23255  This file defines the interface definitions and prototypes for the SPI
23256  driver.
23257 *******************************************************************************/
23258 //DOM-IGNORE-BEGIN
23259 /*******************************************************************************
23260 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23261 Microchip licenses to you the right to use, modify, copy and distribute
23262 Software only when embedded on a Microchip microcontroller or digital signal
23263 controller that is integrated into your product or third party product
23264 (pursuant to the sublicense terms in the accompanying license agreement).
23265 You should refer to the license agreement accompanying this Software for
23266 additional information regarding your rights and obligations.
23267 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23268 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23269 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23270 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23271 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23272 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23273 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23274 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23275 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23276 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23277 *******************************************************************************/
23278 //DOM-IGNORE-END
23279 #ifndef _DRV_SPI_DEFINITIONS_H
23280 #define _DRV_SPI_DEFINITIONS_H
23281 // *****************************************************************************
23282 // *****************************************************************************
23283 // Section: Data Types
23284 // *****************************************************************************
23285 // *****************************************************************************
23286 #include <stdint.h>
23287 #include <stdbool.h>
23288 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23289 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23290 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23291 /*******************************************************************************
23292  SPI Peripheral Library Interface Header
23293  Company:
23294  Microchip Technology Inc.
23295  File Name:
23296  plib_spi.h
23297  Summary:
23298  SPI Peripheral Library Interface Header for common definitions.
23299  Description:
23300  This header file contains the function prototypes and definitions of
23301  the data types and constants that make up the interface to the SPI
23302  PLIB.
23303  *******************************************************************************/
23304 // DOM-IGNORE-BEGIN
23305 /*******************************************************************************
23306 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23307 Microchip licenses to you the right to use, modify, copy and distribute
23308 Software only when embedded on a Microchip microcontroller or digital signal
23309 controller that is integrated into your product or third party product
23310 (pursuant to the sublicense terms in the accompanying license agreement).
23311 You should refer to the license agreement accompanying this Software for
23312 additional information regarding your rights and obligations.
23313 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23314 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23315 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23316 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23317 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23318 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23319 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23320 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23321 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23322 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23323  *******************************************************************************/
23324 // DOM-IGNORE-END
23325 #ifndef _PLIB_SPI_H
23326 #define _PLIB_SPI_H
23327 // DOM-IGNORE-BEGIN
23328 // DOM-IGNORE-END
23329 // *****************************************************************************
23330 // *****************************************************************************
23331 // Section: Included Files (continued at end of file)
23332 // *****************************************************************************
23333 // *****************************************************************************
23334 /* This section lists the other files that are included in this file. However,
23335  please see the end of the file for additional implementation header files
23336  that are also included.
23337  */
23338 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23339 //DOM-IGNORE-BEGIN
23340 /*******************************************************************************
23341 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23342 Microchip licenses to you the right to use, modify, copy and distribute
23343 Software only when embedded on a Microchip microcontroller or digital signal
23344 controller that is integrated into your product or third party product
23345 (pursuant to the sublicense terms in the accompanying license agreement).
23346 You should refer to the license agreement accompanying this Software for
23347 additional information regarding your rights and obligations.
23348 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23349 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23350 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23351 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23352 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23353 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23354 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23355 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23356 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23357 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23358  *******************************************************************************/
23359 //DOM-IGNORE-END
23360 #ifndef _PLIB_SPI_PROCESSOR_H
23361 #define _PLIB_SPI_PROCESSOR_H
23362 #error "Can't find header"
23363 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23364 /* CLOSE_FILE Include File */
23365 
23366 // *****************************************************************************
23367 // *****************************************************************************
23368 // Section: Constants & Data Types
23369 // *****************************************************************************
23370 // *****************************************************************************
23371 // *****************************************************************************
23372 // *****************************************************************************
23373 // Section: SPI Peripheral Library Interface Routines
23374 // *****************************************************************************
23375 // *****************************************************************************
23376 //******************************************************************************
23377 /* Function:
23378  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23379  Summary:
23380  Enables the SPI module.
23381  Description:
23382  This function enables the SPI module.
23383  This operation is atomic.
23384  Precondition:
23385  None.
23386  Parameters:
23387  index - Identifier for the device instance to be configured
23388  Returns:
23389  None.
23390  Example:
23391  <code>
23392  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23393  // application developer.
23394  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23395  </code>
23396  Remarks:
23397  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23398  before use.
23399  This function implements an operation of the enable control feature. This
23400  feature may not be available on all devices. Please refer to the specific
23401  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23402  in your application to automatically determine whether this feature is available.
23403  */
23404 
23405 void
23406  PLIB_SPI_Enable (
23407  SPI_MODULE_ID index ) ;
23408 //******************************************************************************
23409 /* Function:
23410  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23411  Summary:
23412  Disables the SPI module.
23413  Description:
23414  This function disables the SPI module.
23415  This operation is atomic.
23416  Precondition:
23417  None.
23418  Parameters:
23419  index - Identifier for the device instance to be configured
23420  Returns:
23421  None.
23422  Example:
23423  <code>
23424  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23425  // application developer.
23426  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23427  </code>
23428  Remarks:
23429  This function implements an operation of the enable control feature. This
23430  feature may not be available on all devices. Please refer to the specific
23431  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23432  in your application to automatically determine whether this feature is available.
23433  */
23434 
23435 void
23437  SPI_MODULE_ID index ) ;
23438 //******************************************************************************
23439 /* Function:
23440  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23441  Summary:
23442  Discontinues module operation when the device enters Idle mode.
23443  Description:
23444  This function sets up the SPI module such that module operation is disabled
23445  when the device enters Idle mode.
23446  This operation is atomic.
23447  Precondition:
23448  None.
23449  Parameters:
23450  index - Identifier for the device instance to be configured
23451  Returns:
23452  None.
23453  Example:
23454  <code>
23455  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23456  // application developer.
23457  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23458  </code>
23459  Remarks:
23460  This function implements an operation of the stop in idle control feature.
23461  This feature may not be available on all devices. Please refer to the
23462  specific device data sheet to determine availability or use
23463  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23464  determine if this feature is available.
23465  */
23466 
23467 void
23469  SPI_MODULE_ID index ) ;
23470 //******************************************************************************
23471 /* Function:
23472  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23473  Summary:
23474  Continues module operation when the device enters Idle mode.
23475  Description:
23476  This function sets up the SPI module such that module operation is continued
23477  when the device enters Idle mode.
23478  This operation is atomic.
23479  Precondition:
23480  None.
23481  Parameters:
23482  index - Identifier for the device instance to be configured
23483  Returns:
23484  None.
23485  Example:
23486  <code>
23487  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23488  // application developer.
23489  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23490  </code>
23491  Remarks:
23492  This function implements an operation of the stop in idle control feature.
23493  This feature may not be available on all devices. Please refer to the
23494  specific device data sheet to determine availability or use
23495  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23496  this feature is available.
23497  */
23498 
23499 void
23501  SPI_MODULE_ID index ) ;
23502 //******************************************************************************
23503 /* Function:
23504  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23505  Summary:
23506  Returns the current status of the SPI receiver overflow.
23507  Description:
23508  This function returns the current status of the SPI receiver overflow.
23509  This operation is atomic.
23510  Precondition:
23511  None.
23512  Parameters:
23513  index - Identifier for the device instance to be configured
23514  Returns:
23515  SPI receiver overflow status:
23516  - true - A new byte/word is completely received and discarded.
23517  The user software has not read the previous data in
23518  the SPI buffer register.
23519  - false - No Overflow has occurred
23520  Example:
23521  <code>
23522  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23523  // application developer.
23524  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23525  </code>
23526  Remarks:
23527  This function implements an operation of the receiver overflow status feature.
23528  This feature may not be available on all devices. Please refer to the
23529  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23530  in your application to automatically determine whether this feature is available.
23531  */
23532 
23533 bool
23535  SPI_MODULE_ID index ) ;
23536 //******************************************************************************
23537 /* Function:
23538  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23539  Summary:
23540  Clears the SPI receive overflow flag.
23541  Description:
23542  This function clears the SPI receive overflow flag.
23543  This operation is atomic.
23544  Precondition:
23545  None.
23546  Parameters:
23547  index - Identifier for the device instance to be configured
23548  Returns:
23549  None.
23550  Example:
23551  <code>
23552  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23553  // application developer.
23554  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23555  </code>
23556  Remarks:
23557  This function implements an operation of the receiver overflow status feature.
23558  This feature may not be available on all devices. Please refer to the
23559  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23560  in your application to automatically determine whether this feature is available.
23561  */
23562 
23563 void
23565  SPI_MODULE_ID index ) ;
23566 //******************************************************************************
23567 /* Function:
23568  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23569  Summary:
23570  Returns the current transmit buffer status of the SPI module.
23571  Description:
23572  This function returns the current transmit buffer status of the SPI module.
23573  This operation is atomic.
23574  Precondition:
23575  None.
23576  Parameters:
23577  index - Identifier for the device instance to be configured
23578  Returns:
23579  - true - Transmit not yet started, transmit buffer is full
23580  - false - Transmit started, transmit buffer is empty/not full
23581  Example:
23582  <code>
23583  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23584  // application developer.
23585  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23586  </code>
23587  Remarks:
23588  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23589  occur, loading the transmit buffer. Automatically cleared in hardware when
23590  the SPI module transfers data from the transmit buffer to the shift register.
23591  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23592  occur, loading the last available buffer. Automatically cleared in hardware
23593  when the buffer is available for writing.
23594  This function implements an operation of the transmit buffer status feature.
23595  This feature may not be available on all devices. Please refer to the
23596  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23597  in your application to automatically determine whether this feature is available.
23598  */
23599 
23600 bool
23602  SPI_MODULE_ID index ) ;
23603 //******************************************************************************
23604 /* Function:
23605  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23606  Summary:
23607  Returns the current status of the SPI receive buffer.
23608  Description:
23609  This function returns the current status of the SPI receive buffer.
23610  This operation is atomic.
23611  Precondition:
23612  None.
23613  Parameters:
23614  index - Identifier for the device instance to be configured
23615  Returns:
23616  Receiver Buffer Full Status:
23617  - true - Receive complete, receive buffer is full
23618  - false - Receive is not complete, receive buffer is empty
23619  Example:
23620  <code>
23621  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23622  // application developer.
23623  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23624  </code>
23625  Remarks:
23626  In Standard Buffer mode - automatically set in hardware when the SPI module
23627  transfers data from the shift register to the receive buffer. Automatically
23628  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23629  In Enhanced Buffer mode - automatically set in hardware when the SPI module
23630  transfers data from the shift register to the receive buffer, filling the
23631  last unread buffer. Automatically cleared in hardware when a buffer is available
23632  for a transfer from the shift register.
23633  This function implements an operation of the receiver buffer status feature.
23634  This feature may not be available on all devices. Please refer to the
23635  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
23636  in your application to automatically determine whether this feature is available.
23637  */
23638 
23639 bool
23641  SPI_MODULE_ID index ) ;
23642 //******************************************************************************
23643 /* Function:
23644  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
23645  Summary:
23646  Enables the selected SPI pins.
23647  Description:
23648  This function enables the selected SPI pins.
23649  Precondition:
23650  None.
23651  Parameters:
23652  index - Identifier for the device instance to be configured
23653  pin - One of the SPI_PIN enumeration values as the SPI pin
23654  Returns:
23655  None.
23656  Example:
23657  <code>
23658  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23659  // application developer.
23660  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23661  </code>
23662  Remarks:
23663  This function implements an operation of the pin control feature.
23664  This feature may not be available on all devices. Please refer to the
23665  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23666  in your application to automatically determine whether this feature is available.
23667  */
23668 
23669 void
23671  SPI_MODULE_ID index ,
23672  SPI_PIN pin ) ;
23673 //******************************************************************************
23674 /* Function:
23675  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
23676  Summary:
23677  Enables the selected SPI pins.
23678  Description:
23679  This function enables the selected SPI pins.
23680  Precondition:
23681  None.
23682  Parameters:
23683  index - Identifier for the device instance to be configured
23684  pin - One of the SPI_PIN enumeration values as the SPI pin
23685  Returns:
23686  None.
23687  Example:
23688  <code>
23689  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23690  // application developer.
23691  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23692  </code>
23693  Remarks:
23694  This function implements an operation of the pin control feature.
23695  This feature may not be available on all devices. Please refer to the
23696  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23697  in your application to automatically determine whether this feature is available.
23698  */
23699 
23700 void
23702  SPI_MODULE_ID index ,
23703  SPI_PIN pin ) ;
23704 //******************************************************************************
23705 /* Function:
23706  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
23707  SPI_COMMUNICATION_WIDTH width )
23708  Summary:
23709  Selects the data width for the SPI communication.
23710  Description:
23711  This function selects the data width for the SPI communication.
23712  This operation is atomic.
23713  Precondition:
23714  None.
23715  Parameters:
23716  index - Identifier for the device instance to be configured
23717  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
23718  SPI buffer width
23719  Returns:
23720  None.
23721  Example:
23722  <code>
23723  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23724  // application developer.
23725  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
23726  </code>
23727  Remarks:
23728  This function implements an operation of the communication width feature.
23729  This feature may not be available on all devices. Please refer to the
23730  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
23731  in your application to automatically determine whether this feature is available.
23732  */
23733 
23734 void
23736  SPI_MODULE_ID index ,
23737  SPI_COMMUNICATION_WIDTH width ) ;
23738 //******************************************************************************
23739 /* Function:
23740  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
23741  SPI_AUDIO_COMMUNICATION_WIDTH width )
23742  Summary:
23743  Selects the data width for the SPI audio communication.
23744  Description:
23745  This function selects the data width for the SPI audio communication.
23746  This operation is atomic.
23747  Precondition:
23748  None.
23749  Parameters:
23750  index - Identifier for the device instance to be configured
23751  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
23752  SPI buffer width
23753  Returns:
23754  None.
23755  Example:
23756  <code>
23757  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23758  // application developer.
23759  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
23760  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
23761  </code>
23762  Remarks:
23763  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
23764  This function implements an operation of the audio communication width feature.
23765  This feature may not be available on all devices. Please refer to the
23766  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
23767  in your application to automatically determine whether this feature is available.
23768  */
23769 
23770 void
23772  SPI_MODULE_ID index ,
23773  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
23774 //******************************************************************************
23775 /* Function:
23776  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
23777  SPI_INPUT_SAMPLING_PHASE phase)
23778  Summary:
23779  Selects the SPI data input sample phase.
23780  Description:
23781  This function selects the input sampling phase in Master mode.
23782  Precondition:
23783  None.
23784  Parameters:
23785  index - Identifier for the device instance to be configured
23786  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
23787  sampling phase
23788  Returns:
23789  None.
23790  Example:
23791  <code>
23792  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23793  // application developer.
23794  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
23795  </code>
23796  Remarks:
23797  This function implements an operation of the input sample phase feature.
23798  This feature may not be available on all devices. Please refer to the
23799  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
23800  in your application to automatically determine whether this feature is available.
23801  */
23802 
23803 void
23805  SPI_MODULE_ID index ,
23806  SPI_INPUT_SAMPLING_PHASE phase ) ;
23807 //******************************************************************************
23808 /* Function:
23809  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
23810  SPI_OUTPUT_DATA_PHASE data)
23811  Summary:
23812  Selects serial output data change.
23813  Description:
23814  This function selects serial output data change.
23815  Precondition:
23816  None.
23817  Parameters:
23818  index - Identifier for the device instance to be configured
23819  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
23820  SPI serial output data change
23821  Returns:
23822  None.
23823  Example:
23824  <code>
23825  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23826  // application developer.
23827  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
23828  </code>
23829  Remarks:
23830  This function implements an operation of the output data phase feature.
23831  This feature may not be available on all devices. Please refer to the
23832  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
23833  in your application to automatically determine whether this feature is available.
23834  */
23835 
23836 void
23838  SPI_MODULE_ID index ,
23839  SPI_OUTPUT_DATA_PHASE phase ) ;
23840 //******************************************************************************
23841 /* Function:
23842  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
23843  SPI_CLOCK_POLARITY polarity)
23844  Summary:
23845  Enables clock polarity.
23846  Description:
23847  This function enables clock polarity.
23848  Precondition:
23849  None.
23850  Parameters:
23851  index - Identifier for the device instance to be configured
23852  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
23853  Returns:
23854  None.
23855  Example:
23856  <code>
23857  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23858  // application developer.
23859  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
23860  </code>
23861  Remarks:
23862  This function implements an operation of the clock polarity feature.
23863  This feature may not be available on all devices. Please refer to the
23864  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
23865  in your application to automatically determine whether this feature is available.
23866  */
23867 
23868 void
23870  SPI_MODULE_ID index ,
23871  SPI_CLOCK_POLARITY polarity ) ;
23872 //******************************************************************************
23873 /* Function:
23874  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
23875  Summary:
23876  Enables the SPI in Master mode.
23877  Description:
23878  This function enables the SPI in Master mode.
23879  This operation is atomic.
23880  Precondition:
23881  None.
23882  Parameters:
23883  index - Identifier for the device instance to be configured
23884  Returns:
23885  None.
23886  Example:
23887  <code>
23888  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23889  // application developer.
23890  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
23891  </code>
23892  Remarks:
23893  This function implements an operation of the master enable control feature.
23894  This feature may not be available on all devices. Please refer to the
23895  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23896  in your application to automatically determine whether this feature is available.
23897  */
23898 
23899 void
23901  SPI_MODULE_ID index ) ;
23902 //******************************************************************************
23903 /* Function:
23904  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
23905  Summary:
23906  Enables the SPI in Slave mode.
23907  Description:
23908  This function enables the SPI in Slave mode.
23909  This operation is atomic.
23910  Precondition:
23911  None.
23912  Parameters:
23913  index - Identifier for the device instance to be configured
23914  Returns:
23915  None.
23916  Example:
23917  <code>
23918  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23919  // application developer.
23920  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
23921  </code>
23922  Remarks:
23923  This function implements an operation of the master enable control feature.
23924  This feature may not be available on all devices. Please refer to the
23925  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23926  in your application to automatically determine whether this feature is available.
23927  */
23928 
23929 void
23931  SPI_MODULE_ID index ) ;
23932 //******************************************************************************
23933 /* Function:
23934  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
23935  uint32_t baudRate )
23936  Summary:
23937  Sets the baud rate to the desired value.
23938  Description:
23939  This function sets the baud rate to the desired value.
23940  Precondition:
23941  None.
23942  Parameters:
23943  index - Identifier for the device instance to be configured
23944  clockFrequency - Clock frequency
23945  baudrate - Baud rate value
23946  Returns:
23947  None.
23948  Example:
23949  <code>
23950  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23951  // application developer.
23952  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
23953  </code>
23954  Remarks:
23955  Setting a new baud rate value causes the baud rate timer to reset.
23956  This ensures that the baud rate timer does not have to overflow before
23957  outputting the new baud rate.
23958  If the system clock is changed during an active receive operation, a
23959  receive error or data loss may result. To avoid this issue, verify that
23960  no receptions are in progress before changing the system clock.
23961  This function implements an operation of the baud rate set feature.
23962  This feature may not be available on all devices. Please refer to the
23963  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
23964  in your application to automatically determine whether this feature is available.
23965  */
23966 
23967 void
23969  SPI_MODULE_ID index ,
23970  uint32_t clockFrequency ,
23971  uint32_t baudRate ) ;
23972 //******************************************************************************
23973 /* Function:
23974  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
23975  Summary:
23976  Returns the current SPI module activity status.
23977  Description:
23978  This function returns the current SPI module activity status.
23979  This operation is atomic.
23980  Precondition:
23981  None.
23982  Parameters:
23983  index - Identifier for the device instance to be configured
23984  Returns:
23985  - true - SPI module is currently busy with some transactions
23986  - false - SPI module is currently idle
23987  Example:
23988  <code>
23989  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23990  // application developer.
23991  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
23992  </code>
23993  Remarks:
23994  This function implements an operation of the bus status feature.
23995  This feature may not be available on all devices. Please refer to the
23996  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
23997  in your application to automatically determine whether this feature is available.
23998  */
23999 
24000 bool
24001  PLIB_SPI_IsBusy (
24002  SPI_MODULE_ID index ) ;
24003 //******************************************************************************
24004 /* Function:
24005  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
24006  Summary:
24007  Returns the current status of the receive (RX) FIFO sign-extended data.
24008  Description:
24009  This function returns the current status of the receive (RX) FIFO
24010  sign-extended data.
24011  This operation is atomic.
24012  Precondition:
24013  None.
24014  Parameters:
24015  index - Identifier for the device instance to be configured
24016  Returns:
24017  - true - Data from RX FIFO is sign-extended
24018  - false - Data from RX FIFO is not sign-extended
24019  Example:
24020  <code>
24021  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24022  // application developer.
24023  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
24024  </code>
24025  Remarks:
24026  This function implements an operation of the data sign feature.
24027  This feature may not be available on all devices. Please refer to the
24028  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
24029  in your application to automatically determine whether this feature is available.
24030  */
24031 
24032 bool
24034  SPI_MODULE_ID index ) ;
24035 //******************************************************************************
24036 /* Function:
24037  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
24038  Summary:
24039  Enables Master mode slave select.
24040  Description:
24041  This function enables Master mode slave select.
24042  This operation is atomic.
24043  Precondition:
24044  None.
24045  Parameters:
24046  index - Identifier for the device instance to be configured
24047  Returns:
24048  None.
24049  Example:
24050  <code>
24051  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24052  // application developer.
24053  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
24054  </code>
24055  Remarks:
24056  This feature does not support Framed SPI mode.
24057  This function implements an operation of the Master mode slave select feature.
24058  This feature may not be available on all devices. Please refer to the
24059  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24060  in your application to automatically determine whether this feature is available.
24061 
24062  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
24063  */
24064 
24065 void
24067  SPI_MODULE_ID index ) ;
24068 //******************************************************************************
24069 /* Function:
24070  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
24071  Summary:
24072  Disables Master mode slave select.
24073  Description:
24074  This function disables Master mode slave select.
24075  This operation is atomic.
24076  Precondition:
24077  None.
24078  Parameters:
24079  index - Identifier for the device instance to be configured
24080  Returns:
24081  None.
24082  Example:
24083  <code>
24084  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24085  // application developer.
24086  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
24087  </code>
24088  Remarks:
24089  This feature does not support Framed SPI mode.
24090  This function implements an operation of the slave select feature.
24091  This feature may not be available on all devices. Please refer to the
24092  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24093  in your application to automatically determine whether this feature is available.
24094 
24095  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24096  */
24097 
24098 void
24100  SPI_MODULE_ID index ) ;
24101 //******************************************************************************
24102 /* Function:
24103  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24104  Summary:
24105  Returns the current status of the transmit underrun.
24106  Description:
24107  This function returns the current status of the transmit underrun.
24108  This operation is atomic.
24109  Precondition:
24110  None.
24111  Parameters:
24112  index - Identifier for the device instance to be configured
24113  Returns:
24114  - true - Transmit buffer has encountered an underrun condition
24115  - false - Transmit buffer run has not encountered an underrun condition
24116  Example:
24117  <code>
24118  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24119  // application developer.
24120  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24121  </code>
24122  Remarks:
24123  Valid in Framed Sync mode.
24124  This function implements an operation of the transmit underrun status feature.
24125  This feature may not be available on all devices. Please refer to the
24126  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24127  in your application to automatically determine whether this feature is available.
24128  */
24129 
24130 bool
24132  SPI_MODULE_ID index ) ;
24133 //******************************************************************************
24134 /* Function:
24135  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24136  Summary:
24137  Clears the SPI transmit underrun flag.
24138  Description:
24139  This function clears the SPI transmit underrun flag.
24140  This operation is atomic.
24141  Precondition:
24142  None.
24143  Parameters:
24144  index - Identifier for the device instance to be configured
24145  Returns:
24146  None.
24147  Example:
24148  <code>
24149  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24150  // application developer.
24151  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24152  </code>
24153  Remarks:
24154  This function implements an operation of the transmit underrun status feature.
24155  This feature may not be available on all devices. Please refer to the
24156  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24157  in your application to automatically determine whether this feature is available.
24158  */
24159 
24160 void
24162  SPI_MODULE_ID index ) ;
24163 //******************************************************************************
24164 /* Function:
24165  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24166  Summary:
24167  Returns the current status of the transmit buffer.
24168  Description:
24169  This function returns the current status of the transmit buffer.
24170  This operation is atomic.
24171  Precondition:
24172  None.
24173  Parameters:
24174  index - Identifier for the device instance to be configured
24175  Returns:
24176  - true - Transmit buffer is empty
24177  - false - Transmit buffer is not empty
24178  Example:
24179  <code>
24180  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24181  // application developer.
24182  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24183  </code>
24184  Remarks:
24185  This function implements an operation of the transmit buffer empty status feature.
24186  This feature may not be available on all devices. Please refer to the
24187  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24188  in your application to automatically determine whether this feature is available.
24189  */
24190 
24191 bool
24193  SPI_MODULE_ID index ) ;
24194 //******************************************************************************
24195 /* Function:
24196  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24197  Summary:
24198  Enables the SPI enhanced buffer.
24199  Description:
24200  This function enables the SPI enhanced buffer.
24201  This operation is atomic.
24202  Precondition:
24203  None.
24204  Parameters:
24205  index - Identifier for the device instance to be configured
24206  Returns:
24207  None.
24208  Example:
24209  <code>
24210  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24211  // application developer.
24212  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24213  </code>
24214  Remarks:
24215  This enables the enhanced buffer mode.
24216  This function implements an operation of the FIFO control feature.
24217  This feature may not be available on all devices. Please refer to the
24218  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24219  in your application to automatically determine whether this feature is available.
24220  */
24221 
24222 void
24224  SPI_MODULE_ID index ) ;
24225 //******************************************************************************
24226 /* Function:
24227  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24228  Summary:
24229  Disables the SPI enhanced buffer.
24230  Description:
24231  This function disables the SPI enhanced buffer.
24232  This operation is atomic.
24233  Precondition:
24234  None.
24235  Parameters:
24236  index - Identifier for the device instance to be configured
24237  Returns:
24238  None.
24239  Example:
24240  <code>
24241  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24242  // application developer.
24243  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24244  </code>
24245  Remarks:
24246  Enables the legacy standard single buffer mode.
24247  This function implements an operation of the FIFO control feature.
24248  This feature may not be available on all devices. Please refer to the
24249  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24250  in your application to automatically determine whether this feature is available.
24251  */
24252 
24253 void
24255  SPI_MODULE_ID index ) ;
24256 //******************************************************************************
24257 /* Function:
24258  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24259  Summary:
24260  Reads the SPI Buffer Element Count bits for either receive or transmit.
24261  Description:
24262  This function reads the number of SPI transfers pending for Master mode
24263  and the number of unread SPI transfers for Slave mode.
24264  Precondition:
24265  None.
24266  Parameters:
24267  index - Identifier for the device instance to be configured
24268  type - One of the SPI_FIFO_TYPE enumeration values
24269  Returns:
24270  CountValue - Buffer element count bits
24271  Example:
24272  <code>
24273  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24274  // application developer.
24275  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24276  </code>
24277  Remarks:
24278  Valid in Enhanced Buffer mode.
24279  This function implements an operation of the FIFO control feature.
24280  This feature may not be available on all devices. Please refer to the
24281  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24282  in your application to automatically determine whether this feature is available.
24283  */
24284 
24285 uint8_t
24287  SPI_MODULE_ID index ,
24288  SPI_FIFO_TYPE type ) ;
24289 //******************************************************************************
24290 /* Function:
24291  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24292  Summary:
24293  Returns the current status of the SPI shift register.
24294  Description:
24295  This function returns the current status of the SPI shift register.
24296  This operation is atomic.
24297  Precondition:
24298  None.
24299  Parameters:
24300  index - Identifier for the device instance to be configured
24301  Returns:
24302  - true - SPI shift register is empty and ready to send or receive
24303  - false - SPI shift register is not empty
24304  Example:
24305  <code>
24306  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24307  // application developer.
24308  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24309  </code>
24310  Remarks:
24311  Valid in Enhanced Buffer mode.
24312  This function implements an operation of the FIFO status feature.
24313  This feature may not be available on all devices. Please refer to the
24314  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24315  in your application to automatically determine whether this feature is available.
24316  */
24317 
24318 bool
24320  SPI_MODULE_ID index ) ;
24321 //******************************************************************************
24322 /* Function:
24323  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24324  Summary:
24325  Returns the current status of the SPI receive FIFO.
24326  Description:
24327  This function returns the current status of the SPI receive FIFO.
24328  This operation is atomic.
24329  Precondition:
24330  None.
24331  Parameters:
24332  index - Identifier for the device instance to be configured
24333  Returns:
24334  - true - Receive FIFO is empty
24335  - false - Receive FIFO is not empty
24336  Example:
24337  <code>
24338  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24339  // application developer.
24340  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24341  </code>
24342  Remarks:
24343  Valid in Enhanced Buffer mode.
24344  This function implements an operation of the FIFO status feature.
24345  This feature may not be available on all devices. Please refer to the
24346  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24347  in your application to automatically determine whether this feature is available.
24348  */
24349 
24350 bool
24352  SPI_MODULE_ID index ) ;
24353 //******************************************************************************
24354 /* Function:
24355  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24356  SPI_FIFO_INTERRUPT mode)
24357  Summary:
24358  Selects the SPI buffer interrupt mode.
24359  Description:
24360  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24361  Precondition:
24362  None.
24363  Parameters:
24364  index - Identifier for the device instance to be configured
24365  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24366  interrupt mode
24367  Returns:
24368  None.
24369  Example:
24370  <code>
24371  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24372  // application developer.
24373  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24374  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24375  </code>
24376  Remarks:
24377  Valid in Enhanced Buffer mode.
24378  This function implements an operation of the FIFO interrupt feature.
24379  This feature may not be available on all devices. Please refer to the
24380  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24381  in your application to automatically determine whether this feature is available.
24382  */
24383 
24384 void
24386  SPI_MODULE_ID index ,
24387  SPI_FIFO_INTERRUPT mode ) ;
24388 //******************************************************************************
24389 /* Function:
24390  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24391  Summary:
24392  Enables framed SPI support.
24393  Description:
24394  This function enables framed SPI support.
24395  This operation is atomic.
24396  Precondition:
24397  None.
24398  Parameters:
24399  index - Identifier for the device instance to be configured
24400  Returns:
24401  None.
24402  Example:
24403  <code>
24404  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24405  // application developer.
24406  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24407  </code>
24408  Remarks:
24409  This function implements an operation of the framed communication feature.
24410  This feature may not be available on all devices. Please refer to the
24411  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24412  in your application to automatically determine whether this feature is available.
24413  */
24414 
24415 void
24417  SPI_MODULE_ID index ) ;
24418 //******************************************************************************
24419 /* Function:
24420  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24421  Summary:
24422  Disables framed SPI support.
24423  Description:
24424  This function disables framed SPI support.
24425  This operation is atomic.
24426  Precondition:
24427  None.
24428  Parameters:
24429  index - Identifier for the device instance to be configured
24430  Returns:
24431  None.
24432  Example:
24433  <code>
24434  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24435  // application developer.
24436  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24437  </code>
24438  Remarks:
24439  This function implements an operation of the framed communication feature.
24440  This feature may not be available on all devices. Please refer to the
24441  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24442  in your application to automatically determine whether this feature is available.
24443  */
24444 
24445 void
24447  SPI_MODULE_ID index ) ;
24448 //******************************************************************************
24449 /* Function:
24450  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24451  SPI_FRAME_PULSE_DIRECTION direction)
24452  Summary:
24453  Selects the frame sync pulse direction.
24454  Description:
24455  This function selects the frame sync pulse direction.
24456  Precondition:
24457  None.
24458  Parameters:
24459  index - Identifier for the device instance to be configured
24460  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24461  as the SPI frame sync pulse polarity
24462  Returns:
24463  None.
24464  Example:
24465  <code>
24466  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24467  // application developer.
24468  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24469  </code>
24470  Remarks:
24471  This function implements an operation of the framed communication feature.
24472  This feature may not be available on all devices. Please refer to the
24473  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24474  in your application to automatically determine whether this feature is available.
24475  */
24476 
24477 void
24479  SPI_MODULE_ID index ,
24480  SPI_FRAME_PULSE_DIRECTION direction ) ;
24481 //******************************************************************************
24482 /* Function:
24483  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24484  SPI_FRAME_PULSE_POLARITY polarity)
24485  Summary:
24486  Selects the frame sync pulse polarity.
24487  Description:
24488  This function selects the frame sync pulse polarity.
24489  Precondition:
24490  None.
24491  Parameters:
24492  index - Identifier for the device instance to be configured
24493  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24494  sync pulse polarity
24495  Returns:
24496  None.
24497  Example:
24498  <code>
24499  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24500  // application developer.
24501  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24502  </code>
24503  Remarks:
24504  Available only for Frame mode.
24505  This function implements an operation of the framed communication feature.
24506  This feature may not be available on all devices. Please refer to the
24507  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24508  in your application to automatically determine whether this feature is available.
24509  */
24510 
24511 void
24513  SPI_MODULE_ID index ,
24514  SPI_FRAME_PULSE_POLARITY polarity ) ;
24515 //******************************************************************************
24516 /* Function:
24517  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24518  SPI_FRAME_PULSE_EDGE edge)
24519  Summary:
24520  Selects the frame sync pulse edge.
24521  Description:
24522  This function selects the frame sync pulse edge.
24523  Precondition:
24524  None.
24525  Parameters:
24526  index - Identifier for the device instance to be configured
24527  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24528  SPI frame sync pulse edge
24529  Returns:
24530  None.
24531  Example:
24532  <code>
24533  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24534  // application developer.
24535  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24536  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24537  </code>
24538  Remarks:
24539  This function implements an operation of the framed communication feature.
24540  This feature may not be available on all devices. Please refer to the
24541  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24542  in your application to automatically determine whether this feature is available.
24543  */
24544 
24545 void
24547  SPI_MODULE_ID index ,
24548  SPI_FRAME_PULSE_EDGE edge ) ;
24549 //******************************************************************************
24550 /* Function:
24551  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24552  SPI_FRAME_PULSE_WIDTH width)
24553  Summary:
24554  Sets the frame sync pulse width.
24555  Description:
24556  This function sets the frame sync pulse width.
24557  Precondition:
24558  None.
24559  Parameters:
24560  index - Identifier for the device instance to be configured
24561  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24562  frame sync pulse width.
24563  Returns:
24564  None.
24565  Example:
24566  <code>
24567  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24568  // application developer.
24569  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24570  </code>
24571  Remarks:
24572  Length of the word is dependent on the communication mode.
24573  This function implements an operation of the framed communication feature.
24574  This feature may not be available on all devices. Please refer to the
24575  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24576  in your application to automatically determine whether this feature is available.
24577  */
24578 
24579 void
24581  SPI_MODULE_ID index ,
24582  SPI_FRAME_PULSE_WIDTH width ) ;
24583 //******************************************************************************
24584 /* Function:
24585  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24586  SPI_FRAME_SYNC_PULSE pulse)
24587  Summary:
24588  Selects at which character the SPI frame sync pulse is generated.
24589  Description:
24590  This function selects at which character the SPI frame sync pulse is generated.
24591  Precondition:
24592  None.
24593  Parameters:
24594  index - Identifier for the device instance to be configured
24595  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24596  frame sync pulse count
24597  Returns:
24598  None.
24599  Example:
24600  <code>
24601  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24602  // application developer.
24603  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24604  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24605  </code>
24606  Remarks:
24607  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24608  This function implements an operation of the framed communication feature.
24609  This feature may not be available on all devices. Please refer to the
24610  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24611  in your application to automatically determine whether this feature is available.
24612  */
24613 
24614 void
24616  SPI_MODULE_ID index ,
24617  SPI_FRAME_SYNC_PULSE pulse ) ;
24618 //******************************************************************************
24619 /* Function:
24620  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24621  Summary:
24622  Returns the current status of the SPI frame error.
24623  Description:
24624  This function returns the current status of the SPI frame error.
24625  This operation is atomic.
24626  Precondition:
24627  None.
24628  Parameters:
24629  index - Identifier for the device instance to be configured
24630  Returns:
24631  - true - Frame error detected
24632  - false - No frame error detected
24633  Example:
24634  <code>
24635  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24636  // application developer.
24637  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
24638  </code>
24639  Remarks:
24640  Valid only if Frame mode is enabled.
24641  This function implements an operation of the framed communication feature.
24642  This feature may not be available on all devices. Please refer to the
24643  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
24644  in your application to automatically determine whether this feature is available.
24645  */
24646 
24647 bool
24649  SPI_MODULE_ID index ) ;
24650 //******************************************************************************
24651 /* Function:
24652  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
24653  Summary:
24654  Clears the SPI frame error flag.
24655  Description:
24656  This function clears the SPI frame error flag.
24657  This operation is atomic.
24658  Precondition:
24659  None.
24660  Parameters:
24661  index - Identifier for the device instance to be configured
24662  Returns:
24663  None.
24664  Example:
24665  <code>
24666  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24667  // application developer.
24668  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
24669  </code>
24670  Remarks:
24671  This function implements an operation of the frame error status feature.
24672  This feature may not be available on all devices. Please refer to the
24673  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
24674  in your application to automatically determine whether this feature is available.
24675  */
24676 
24677 void
24679  SPI_MODULE_ID index ) ;
24680 //******************************************************************************
24681 /* Function:
24682  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
24683  Summary:
24684  Clears the SPI receive buffer.
24685  Description:
24686  This function clears the SPI receive buffer.
24687  In Enhanced Buffer mode, this functions clears the full RX FIFO.
24688  This operation is atomic.
24689  Precondition:
24690  None.
24691  Parameters:
24692  index - Identifier for the device instance to be configured
24693  Returns:
24694  None.
24695  Example:
24696  <code>
24697  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24698  // application developer.
24699  //This call will flush the receive buffer.
24700  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
24701  </code>
24702  Remarks:
24703  This function implements an operation of the buffer control feature.
24704  This feature may not be available on all devices. Please refer to the
24705  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24706  in your application to automatically determine whether this feature is available.
24707  */
24708 
24709 void
24711  SPI_MODULE_ID index ) ;
24712 //******************************************************************************
24713 /* Function:
24714  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
24715  Summary:
24716  Returns the SPI buffer value.
24717  Description:
24718  This function returns the SPI buffer value.
24719  This operation is atomic.
24720  Precondition:
24721  None.
24722  Parameters:
24723  index - Identifier for the device instance to be configured
24724  Returns:
24725  Reads the SPI buffer.
24726  Example:
24727  <code>
24728  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24729  // application developer.
24730  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
24731  </code>
24732  Remarks:
24733  This function implements an operation of the buffer control feature.
24734  This feature may not be available on all devices. Please refer to the
24735  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24736  in your application to automatically determine whether this feature is available.
24737  */
24738 
24739 uint8_t
24741  SPI_MODULE_ID index ) ;
24742 //******************************************************************************
24743 /* Function:
24744  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
24745  Summary:
24746  Returns 16-bit SPI buffer value.
24747  Description:
24748  This function returns 16-bit SPI buffer value.
24749  This operation is atomic.
24750  Precondition:
24751  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24752  Parameters:
24753  index - Identifier for the device instance to be configured
24754  Returns:
24755  Returns the SPI 16-bit buffer value.
24756  Example:
24757  <code>
24758 #define MY_SPI_INSTANCE SPI_ID_1
24759 
24760  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
24761  </code>
24762  Remarks:
24763  This function implements an operation of the buffer control feature.
24764  This feature may not be available on all devices. Please refer to the
24765  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24766  in your application to automatically determine whether this feature is available.
24767  */
24768 
24769 uint16_t
24771  SPI_MODULE_ID index ) ;
24772 //******************************************************************************
24773 /* Function:
24774  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
24775  Summary:
24776  Returns 32-bit SPI buffer value.
24777  Description:
24778  This function returns 32-bit SPI buffer value.
24779  This operation is atomic.
24780  Precondition:
24781  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24782  Parameters:
24783  index - Identifier for the device instance to be configured
24784  Returns:
24785  Returns the SPI 32-bit buffer value.
24786  Example:
24787  <code>
24788 #define MY_SPI_INSTANCE SPI_ID_1
24789 
24790  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
24791  </code>
24792  Remarks:
24793  This function implements an operation of the buffer control feature.
24794  This feature may not be available on all devices. Please refer to the
24795  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24796  in your application to automatically determine whether this feature is available.
24797  */
24798 
24799 uint32_t
24801  SPI_MODULE_ID index ) ;
24802 //******************************************************************************
24803 /* Function:
24804  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
24805  Summary:
24806  Write the data to the SPI buffer.
24807  Description:
24808  This function writes data to the SPI buffer.
24809  This operation is atomic.
24810  Precondition:
24811  None.
24812  Parameters:
24813  index - Identifier for the device instance to be configured
24814  data - Data to written to the SPI buffer
24815  Returns:
24816  None.
24817  Example:
24818  <code>
24819  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24820  // application developer.
24821  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
24822  </code>
24823  Remarks:
24824  This function implements an operation of the buffer control feature.
24825  This feature may not be available on all devices. Please refer to the
24826  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24827  in your application to automatically determine whether this feature is available.
24828  */
24829 
24830 void
24832  SPI_MODULE_ID index ,
24833  uint8_t data ) ;
24834 //******************************************************************************
24835 /* Function:
24836  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
24837  Summary:
24838  Writes 16-bit data to the SPI buffer.
24839  Description:
24840  This function writes 16-bit data to the SPI buffer.
24841  This operation is atomic.
24842  Precondition:
24843  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24844  Parameters:
24845  index - Identifier for the device instance to be configured
24846  data - 16-bit data to be written to the SPI buffer
24847  Returns:
24848  None.
24849  Example:
24850  <code>
24851 #define MY_SPI_INSTANCE SPI_ID_1
24852 
24853  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
24854  </code>
24855  Remarks:
24856  This function implements an operation of the buffer control feature.
24857  This feature may not be available on all devices. Please refer to the
24858  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24859  in your application to automatically determine whether this feature is available.
24860  */
24861 
24862 void
24864  SPI_MODULE_ID index ,
24865  uint16_t data ) ;
24866 //******************************************************************************
24867 /* Function:
24868  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
24869  Summary:
24870  Write 32-bit data to the SPI buffer.
24871  Description:
24872  This function writes 32-bit data to the SPI buffer.
24873  This operation is atomic.
24874  Precondition:
24875  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24876  Parameters:
24877  index - Identifier for the device instance to be configured
24878  data - 32-bit data to be written to the SPI buffer
24879  Returns:
24880  None.
24881  Example:
24882  <code>
24883 #define MY_SPI_INSTANCE SPI_ID_1
24884 
24885  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
24886  </code>
24887  Remarks:
24888  This function implements an operation of the buffer control feature.
24889  This feature may not be available on all devices. Please refer to the
24890  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24891  in your application to automatically determine whether this feature is available.
24892  */
24893 
24894 void
24896  SPI_MODULE_ID index ,
24897  uint32_t data ) ;
24898 //******************************************************************************
24899 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
24900  Summary:
24901  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
24902  register.
24903  Description:
24904  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
24905  (SPIxRXB)) register.
24906  This operation is atomic.
24907  Preconditions:
24908  None.
24909  Parameters:
24910  index - Identifier for the device instance
24911  Returns:
24912  The address of the SPIxBUF register
24913  Remarks:
24914  None.
24915 */
24916 
24917 void *
24919  SPI_MODULE_ID index ) ;
24920 //******************************************************************************
24921 /* Function:
24922  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
24923  SPI_BAUD_RATE_CLOCK type)
24924  Summary:
24925  Selects the type of clock is used by the Baud Rate Generator.
24926  Description:
24927  This function selects the type of clock is used by the Baud Rate Generator.
24928  Precondition:
24929  None.
24930  Parameters:
24931  index - Identifier for the device instance to be configured
24932  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
24933  Returns:
24934  None.
24935  Example:
24936  <code>
24937  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24938  // application developer.
24939  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
24940  </code>
24941  Remarks:
24942  This function implements an operation of the baud rate clock control feature.
24943  This feature may not be available on all devices. Please refer to the
24944  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
24945  in your application to automatically determine whether this feature is available.
24946  */
24947 
24948 void
24950  SPI_MODULE_ID index ,
24951  SPI_BAUD_RATE_CLOCK type ) ;
24952 //******************************************************************************
24953 /* Function:
24954  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
24955  SPI_ERROR_INTERRUPT error)
24956  Summary:
24957  Enables SPI error interrupts
24958  Description:
24959  This function enables SPI error interrupts.
24960  Precondition:
24961  None.
24962  Parameters:
24963  index - Identifier for the device instance to be configured
24964  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
24965  SPI interrupt error
24966  Returns:
24967  None.
24968  Example:
24969  <code>
24970  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24971  // application developer.
24972  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24973  </code>
24974  Remarks:
24975  This function implements an operation of the error interrupt control feature.
24976  This feature may not be available on all devices. Please refer to the
24977  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24978  in your application to automatically determine whether this feature is available.
24979  */
24980 
24981 void
24983  SPI_MODULE_ID index ,
24984  SPI_ERROR_INTERRUPT error ) ;
24985 //******************************************************************************
24986 /* Function:
24987  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
24988  SPI_ERROR_INTERRUPT error)
24989  Summary:
24990  Enables SPI error interrupts.
24991  Description:
24992  This function enables SPI error interrupts.
24993  Precondition:
24994  None.
24995  Parameters:
24996  index - Identifier for the device instance to be configured
24997  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
24998  SPI interrupt error
24999  Returns:
25000  None.
25001  Example:
25002  <code>
25003  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25004  // application developer.
25005  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
25006  </code>
25007  Remarks:
25008  This function implements an operation of the error interrupt control feature.
25009  This feature may not be available on all devices. Please refer to the
25010  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
25011  in your application to automatically determine whether this feature is available.
25012  */
25013 
25014 void
25016  SPI_MODULE_ID index ,
25017  SPI_ERROR_INTERRUPT error ) ;
25018 //******************************************************************************
25019 /* Function:
25020  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
25021  Summary:
25022  Enables the SPI error.
25023  Description:
25024  This function enables the SPI error.
25025  This operation is atomic.
25026  Precondition:
25027  None.
25028  Parameters:
25029  index - Identifier for the device instance to be configured
25030  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
25031  Returns:
25032  None.
25033  Example:
25034  <code>
25035  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25036  // application developer.
25037  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
25038  </code>
25039  Remarks:
25040  This function implements an operation of the audio error control feature.
25041  This feature may not be available on all devices. Please refer to the
25042  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
25043  in your application to automatically determine whether this feature is available.
25044  */
25045 
25046 void
25048  SPI_MODULE_ID index ,
25049  SPI_AUDIO_ERROR error ) ;
25050 //******************************************************************************
25051 /* Function:
25052  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
25053  Summary:
25054  Disables the SPI error.
25055  Description:
25056  This function disables the SPI error.
25057  This operation is atomic.
25058  Precondition:
25059  None.
25060  Parameters:
25061  index - Identifier for the device instance to be configured
25062  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
25063  Returns:
25064  None.
25065  Example:
25066  <code>
25067  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25068  // application developer.
25069  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
25070  </code>
25071  Remarks:
25072  This function implements an operation of the audio error control feature.
25073  This feature may not be available on all devices. Please refer to the
25074  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
25075  in your application to automatically determine whether this feature is available.
25076  */
25077 
25078 void
25080  SPI_MODULE_ID index ,
25081  SPI_AUDIO_ERROR error ) ;
25082 //******************************************************************************
25083 /* Function:
25084  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
25085  Summary:
25086  Audio protocol is enabled.
25087  Description:
25088  This function enables the audio protocol.
25089  This operation is atomic.
25090  Precondition:
25091  Disable the SPI module by calling PLIB_SPI_Disable.
25092  Parameters:
25093  index - Identifier for the device instance to be configured
25094  Returns:
25095  None.
25096  Example:
25097  <code>
25098  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25099  // application developer.
25100  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25101  </code>
25102  Remarks:
25103  This function implements an operation of the audio protocol control feature.
25104  This feature may not be available on all devices. Please refer to the
25105  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25106  in your application to automatically determine whether this feature is available.
25107  */
25108 
25109 void
25111  SPI_MODULE_ID index ) ;
25112 //******************************************************************************
25113 /* Function:
25114  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25115  Summary:
25116  Audio protocol is disabled.
25117  Description:
25118  This function disables the audio protocol.
25119  This operation is atomic.
25120  Precondition:
25121  None.
25122  Parameters:
25123  index - Identifier for the device instance to be configured
25124  Returns:
25125  None.
25126  Example:
25127  <code>
25128  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25129  // application developer.
25130  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25131  </code>
25132  Remarks:
25133  This function implements an operation of the audio protocol control feature.
25134  This feature may not be available on all devices. Please refer to the
25135  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25136  in your application to automatically determine whether this feature is available.
25137  */
25138 
25139 void
25141  SPI_MODULE_ID index ) ;
25142 //******************************************************************************
25143 /* Function:
25144  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25145  SPI_AUDIO_TRANSMIT_MODE mode)
25146  Summary:
25147  Selects the transmit audio data format.
25148  Description:
25149  This function selects the transmit audio data format.
25150  Precondition:
25151  None.
25152  Parameters:
25153  index - Identifier for the device instance to be configured
25154  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25155  transmit audio format
25156  Returns:
25157  None.
25158  Example:
25159  <code>
25160  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25161  // application developer.
25162  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25163  </code>
25164  Remarks:
25165  This function implements an operation of the audio transmit mode feature.
25166  This feature may not be available on all devices. Please refer to the
25167  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25168  in your application to automatically determine whether this feature is available.
25169  */
25170 
25171 void
25173  SPI_MODULE_ID index ,
25174  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25175 //******************************************************************************
25176 /* Function:
25177  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25178  SPI_AUDIO_PROTOCOL mode )
25179  Summary:
25180  Selects the Audio Protocol mode.
25181  Description:
25182  This function selects the Audio Protocol mode.
25183  Precondition:
25184  None.
25185  Parameters:
25186  index - Identifier for the device instance to be configured
25187  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25188  audio protocol
25189  Returns:
25190  None.
25191  Example:
25192  <code>
25193  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25194  // application developer.
25195  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25196  </code>
25197  Remarks:
25198  This function implements an operation of the audio protocol mode feature.
25199  This feature may not be available on all devices. Please refer to the
25200  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25201  in your application to automatically determine whether this feature is available.
25202  */
25203 
25204 void
25206  SPI_MODULE_ID index ,
25207  SPI_AUDIO_PROTOCOL mode ) ;
25208 // *****************************************************************************
25209 // *****************************************************************************
25210 // Section: SPI Peripheral Library Exists Functions
25211 // *****************************************************************************
25212 // *****************************************************************************
25213 /* The following functions indicate the existence of the features on the device.
25214 */
25215 //******************************************************************************
25216 /* Function:
25217  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25218  Summary:
25219  Identifies whether the EnableControl feature exists on the SPI module.
25220  Description:
25221  This function identifies whether the EnableControl feature is available on
25222  the SPI module.
25223  When this function returns true, these functions are supported on the device:
25224  - PLIB_SPI_Enable
25225  - PLIB_SPI_Disable
25226  This operation is atomic.
25227  Preconditions:
25228  None.
25229  Parameters:
25230  index - Identifier for the device instance
25231  Returns:
25232  - true - The EnableControl feature is supported on the device
25233  - false - The EnableControl feature is not supported on the device
25234  Remarks:
25235  None.
25236 */
25237 
25238 bool
25240  SPI_MODULE_ID index ) ;
25241 //******************************************************************************
25242 /* Function:
25243  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25244  Summary:
25245  Identifies whether the StopInIdle feature exists on the SPI module.
25246  Description:
25247  This function identifies whether the StopInIdle feature is available on the
25248  SPI module.
25249  When this function returns true, these functions are supported on the device:
25250  - PLIB_SPI_StopInIdleEnable
25251  - PLIB_SPI_StopInIdleDisable
25252  This operation is atomic.
25253  Preconditions:
25254  None.
25255  Parameters:
25256  index - Identifier for the device instance
25257  Returns:
25258  - true - The StopInIdle feature is supported on the device
25259  - false - The StopInIdle feature is not supported on the device
25260  Remarks:
25261  None.
25262 */
25263 
25264 bool
25266  SPI_MODULE_ID index ) ;
25267 //******************************************************************************
25268 /* Function:
25269  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25270  Summary:
25271  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25272  Description:
25273  This function identifies whether the ReceiverOverflow feature is available
25274  on the SPI module.
25275  When this function returns true, these functions are supported on the device:
25276  - PLIB_SPI_ReceiverHasOverflowed
25277  - PLIB_SPI_ReceiverOverflowClear
25278  This operation is atomic.
25279  Preconditions:
25280  None.
25281  Parameters:
25282  index - Identifier for the device instance
25283  Returns:
25284  - true - The ReceiverOverflow feature is supported on the device
25285  - false - The ReceiverOverflow feature is not supported on the device
25286  Remarks:
25287  None.
25288 */
25289 
25290 bool
25292  SPI_MODULE_ID index ) ;
25293 //******************************************************************************
25294 /* Function:
25295  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25296  Summary:
25297  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25298  Description:
25299  This function identifies whether the TransmitBufferFullStatus feature is available
25300  on the SPI module.
25301  When this function returns true, this function is supported on the device:
25302  - PLIB_SPI_TransmitBufferIsFull
25303  This operation is atomic.
25304  Preconditions:
25305  None.
25306  Parameters:
25307  index - Identifier for the device instance
25308  Returns:
25309  - true - The TransmitBufferFullStatus feature is supported on the device
25310  - false - The TransmitBufferFullStatus feature is not supported on the device
25311  Remarks:
25312  None.
25313 */
25314 
25315 bool
25317  SPI_MODULE_ID index ) ;
25318 //******************************************************************************
25319 /* Function:
25320  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25321  Summary:
25322  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25323  Description:
25324  This function identifies whether the TransmitBufferEmptyStatus feature is available
25325  on the SPI module.
25326  When this function returns true, this function is supported on the device:
25327  - PLIB_SPI_TransmitBufferIsEmpty
25328  This operation is atomic.
25329  Preconditions:
25330  None.
25331  Parameters:
25332  index - Identifier for the device instance
25333  Returns:
25334  - true - The TransmitBufferEmptyStatus feature is supported on the device
25335  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25336  Remarks:
25337  None.
25338 */
25339 
25340 bool
25342  SPI_MODULE_ID index ) ;
25343 //******************************************************************************
25344 /* Function:
25345  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25346  Summary:
25347  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25348  Description:
25349  This function identifies whether the ReceiveBufferStatus feature is available
25350  on the SPI module.
25351  When this function returns true, this function is supported on the device:
25352  - PLIB_SPI_ReceiverBufferIsFull
25353  This operation is atomic.
25354  Preconditions:
25355  None.
25356  Parameters:
25357  index - Identifier for the device instance
25358  Returns:
25359  - true - The ReceiveBufferStatus feature is supported on the device
25360  - false - The ReceiveBufferStatus feature is not supported on the device
25361  Remarks:
25362  None.
25363 */
25364 
25365 bool
25367  SPI_MODULE_ID index ) ;
25368 //******************************************************************************
25369 /* Function:
25370  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25371  Summary:
25372  Identifies whether the PinControl feature exists on the SPI module.
25373  Description:
25374  This function identifies whether the PinControl feature is available on the
25375  SPI module.
25376  When this function returns true, these functions are supported on the device:
25377  - PLIB_SPI_PinEnable
25378  - PLIB_SPI_PinDisable
25379  This operation is atomic.
25380  Preconditions:
25381  None.
25382  Parameters:
25383  index - Identifier for the device instance
25384  Returns:
25385  - true - The PinControl feature is supported on the device
25386  - false - The PinControl feature is not supported on the device
25387  Remarks:
25388  None.
25389 */
25390 
25391 bool
25393  SPI_MODULE_ID index ) ;
25394 //******************************************************************************
25395 /* Function:
25396  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25397  Summary:
25398  Identifies whether the CommunicationWidth feature exists on the SPI module.
25399  Description:
25400  This function identifies whether the CommunicationWidth feature is available
25401  on the SPI module.
25402  When this function returns true, this function is supported on the device:
25403  - PLIB_SPI_CommunicationWidthSelect
25404  This operation is atomic.
25405  Preconditions:
25406  None.
25407  Parameters:
25408  index - Identifier for the device instance
25409  Returns:
25410  - true - The CommunicationWidth feature is supported on the device
25411  - false - The CommunicationWidth feature is not supported on the device
25412  Remarks:
25413  None.
25414 */
25415 
25416 bool
25418  SPI_MODULE_ID index ) ;
25419 //******************************************************************************
25420 /* Function:
25421  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25422  Summary:
25423  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25424  Description:
25425  This function identifies whether the AudioCommunicationWidth feature is available
25426  on the SPI module.
25427  When this function returns true, this function is supported on the device:
25428  - PLIB_SPI_AudioCommunicationWidthSelect
25429  This operation is atomic.
25430  Preconditions:
25431  None.
25432  Parameters:
25433  index - Identifier for the device instance
25434  Returns:
25435  - true - The AudioCommunicationWidth feature is supported on the device
25436  - false - The AudioCommunicationWidth feature is not supported on the device
25437  Remarks:
25438  None.
25439 */
25440 
25441 bool
25443  SPI_MODULE_ID index ) ;
25444 //******************************************************************************
25445 /* Function:
25446  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25447  Summary:
25448  Identifies whether the InputSamplePhase feature exists on the SPI module.
25449  Description:
25450  This function identifies whether the InputSamplePhase feature is available
25451  on the SPI module.
25452  When this function returns true, this function is supported on the device:
25453  - PLIB_SPI_InputSamplePhaseSelect
25454  This operation is atomic.
25455  Preconditions:
25456  None.
25457  Parameters:
25458  index - Identifier for the device instance
25459  Returns:
25460  - true - The InputSamplePhase feature is supported on the device
25461  - false - The InputSamplePhase feature is not supported on the device
25462  Remarks:
25463  None.
25464 */
25465 
25466 bool
25468  SPI_MODULE_ID index ) ;
25469 //******************************************************************************
25470 /* Function:
25471  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25472  Summary:
25473  Identifies whether the OutputDataPhase feature exists on the SPI module.
25474  Description:
25475  This function identifies whether the OutputDataPhase feature is available on
25476  the SPI module.
25477  When this function returns true, this function is supported on the device:
25478  - PLIB_SPI_OutputDataPhaseSelect
25479  This operation is atomic.
25480  Preconditions:
25481  None.
25482  Parameters:
25483  index - Identifier for the device instance
25484  Returns:
25485  - true - The OutputDataPhase feature is supported on the device
25486  - false - The OutputDataPhase feature is not supported on the device
25487  Remarks:
25488  None.
25489 */
25490 
25491 bool
25493  SPI_MODULE_ID index ) ;
25494 //******************************************************************************
25495 /* Function:
25496  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25497  Summary:
25498  Identifies whether the ClockPolarity feature exists on the SPI module.
25499  Description:
25500  This function identifies whether the ClockPolarity feature is available on
25501  the SPI module.
25502  When this function returns true, this function is supported on the device:
25503  - PLIB_SPI_ClockPolaritySelect
25504  This operation is atomic.
25505  Preconditions:
25506  None.
25507  Parameters:
25508  index - Identifier for the device instance
25509  Returns:
25510  - true - The ClockPolarity feature is supported on the device
25511  - false - The ClockPolarity feature is not supported on the device
25512  Remarks:
25513  None.
25514 */
25515 
25516 bool
25518  SPI_MODULE_ID index ) ;
25519 //******************************************************************************
25520 /* Function:
25521  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25522  Summary:
25523  Identifies whether the MasterControl feature exists on the SPI module.
25524  Description:
25525  This function identifies whether the MasterControl feature is available on
25526  the SPI module.
25527  When this function returns true, these functions are supported on the device:
25528  - PLIB_SPI_MasterEnable
25529  - PLIB_SPI_SlaveEnable
25530  This operation is atomic.
25531  Preconditions:
25532  None.
25533  Parameters:
25534  index - Identifier for the device instance
25535  Returns:
25536  - true - The MasterControl feature is supported on the device
25537  - false - The MasterControl feature is not supported on the device
25538  Remarks:
25539  None.
25540 */
25541 
25542 bool
25544  SPI_MODULE_ID index ) ;
25545 //******************************************************************************
25546 /* Function:
25547  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25548  Summary:
25549  Identifies whether the BaudRate feature exists on the SPI module.
25550  Description:
25551  This function identifies whether the BaudRate feature is available on the SPI
25552  module.
25553  When this function returns true, this function is supported on the device:
25554  - PLIB_SPI_BaudRateSet
25555  This operation is atomic.
25556  Preconditions:
25557  None.
25558  Parameters:
25559  index - Identifier for the device instance
25560  Returns:
25561  - true - The BaudRate feature is supported on the device
25562  - false - The BaudRate feature is not supported on the device
25563  Remarks:
25564  None.
25565 */
25566 
25567 bool
25569  SPI_MODULE_ID index ) ;
25570 //******************************************************************************
25571 /* Function:
25572  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25573  Summary:
25574  Identifies whether the BusStatus feature exists on the SPI module.
25575  Description:
25576  This function identifies whether the BusStatus feature is available on the
25577  SPI module.
25578  When this function returns true, this function is supported on the device:
25579  - PLIB_SPI_IsBusy
25580  This operation is atomic.
25581  Preconditions:
25582  None.
25583  Parameters:
25584  index - Identifier for the device instance
25585  Returns:
25586  - true - The BusStatus feature is supported on the device
25587  - false - The BusStatus feature is not supported on the device
25588  Remarks:
25589  None.
25590 */
25591 
25592 bool
25594  SPI_MODULE_ID index ) ;
25595 //******************************************************************************
25596 /* Function:
25597  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25598  Summary:
25599  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25600  Description:
25601  This function identifies whether the ReadDataSignStatus feature is available
25602  on the SPI module.
25603  When this function returns true, this function is supported on the device:
25604  - PLIB_SPI_ReadDataIsSignExtended
25605  This operation is atomic.
25606  Preconditions:
25607  None.
25608  Parameters:
25609  index - Identifier for the device instance
25610  Returns:
25611  - true - The ReadDataSignStatus feature is supported on the device
25612  - false - The ReadDataSignStatus feature is not supported on the device
25613  Remarks:
25614  None.
25615 */
25616 
25617 bool
25619  SPI_MODULE_ID index ) ;
25620 //******************************************************************************
25621 /* Function:
25622  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25623  Summary:
25624  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25625  Description:
25626  This function identifies whether the SlaveSelectControl feature is available
25627  on the SPI module.
25628  When this function returns true, these functions are supported on the device:
25629  - PLIB_SPI_SlaveSelectEnable
25630  - PLIB_SPI_SlaveSelectDisable
25631  This operation is atomic.
25632  Preconditions:
25633  None.
25634  Parameters:
25635  index - Identifier for the device instance
25636  Returns:
25637  - true - The SlaveSelectControl feature is supported on the device
25638  - false - The SlaveSelectControl feature is not supported on the device
25639  Remarks:
25640  None.
25641 */
25642 
25643 bool
25645  SPI_MODULE_ID index ) ;
25646 //******************************************************************************
25647 /* Function:
25648  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
25649  Summary:
25650  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
25651  Description:
25652  This function identifies whether the TransmitUnderRunStatus feature is available
25653  on the SPI module.
25654  When this function returns true, these functions are supported on the device:
25655  - PLIB_SPI_TransmitUnderRunStatusGet
25656  - PLIB_SPI_TransmitUnderRunStatusClear
25657  This operation is atomic.
25658  Preconditions:
25659  None.
25660  Parameters:
25661  index - Identifier for the device instance
25662  Returns:
25663  - true - The TransmitUnderRunStatus feature is supported on the device
25664  - false - The TransmitUnderRunStatus feature is not supported on the device
25665  Remarks:
25666  None.
25667 */
25668 
25669 bool
25671  SPI_MODULE_ID index ) ;
25672 //******************************************************************************
25673 /* Function:
25674  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
25675  Summary:
25676  Identifies whether the FIFOControl feature exists on the SPI module.
25677  Description:
25678  This function identifies whether the FIFOControl feature is available on the
25679  SPI module.
25680  When this function returns true, these functions are supported on the device:
25681  - PLIB_SPI_FIFOEnable
25682  - PLIB_SPI_FIFODisable
25683  This operation is atomic.
25684  Preconditions:
25685  None.
25686  Parameters:
25687  index - Identifier for the device instance
25688  Returns:
25689  - true - The FIFOControl feature is supported on the device
25690  - false - The FIFOControl feature is not supported on the device
25691  Remarks:
25692  None.
25693 */
25694 
25695 bool
25697  SPI_MODULE_ID index ) ;
25698 //******************************************************************************
25699 /* Function:
25700  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
25701  Summary:
25702  Identifies whether the FIFOCount feature exists on the SPI module.
25703  Description:
25704  This function identifies whether the FIFOCount feature is available on the SPI module.
25705  When this function returns true, this function is supported on the device:
25706  - PLIB_SPI_FIFOCountGet
25707  This operation is atomic.
25708  Preconditions:
25709  None.
25710  Parameters:
25711  index - Identifier for the device instance
25712  Returns:
25713  - true - The FIFOCount feature is supported on the device
25714  - false - The FIFOCount feature is not supported on the device
25715  Remarks:
25716  None.
25717 */
25718 
25719 bool
25721  SPI_MODULE_ID index ) ;
25722 //******************************************************************************
25723 /* Function:
25724  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
25725  Summary:
25726  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
25727  Description:
25728  This function identifies whether the ReceiveFIFOStatus feature is available
25729  on the SPI module.
25730  When this function returns true, this function is supported on the device:
25731  - PLIB_SPI_ReceiverFIFOIsEmpty
25732  This operation is atomic.
25733  Preconditions:
25734  None.
25735  Parameters:
25736  index - Identifier for the device instance
25737  Returns:
25738  - true - The ReceiveFIFOStatus feature is supported on the device
25739  - false - The ReceiveFIFOStatus feature is not supported on the device
25740  Remarks:
25741  None.
25742 */
25743 
25744 bool
25746  SPI_MODULE_ID index ) ;
25747 //******************************************************************************
25748 /* Function:
25749  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
25750  Summary:
25751  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
25752  Description:
25753  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
25754  available on the SPI module.
25755  When this function returns true, this function is supported on the device:
25756  - PLIB_SPI_FIFOShiftRegisterIsEmpty
25757  This operation is atomic.
25758  Preconditions:
25759  None.
25760  Parameters:
25761  index - Identifier for the device instance
25762  Returns:
25763  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
25764  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
25765  Remarks:
25766  None.
25767 */
25768 
25769 bool
25771  SPI_MODULE_ID index ) ;
25772 //******************************************************************************
25773 /* Function:
25774  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
25775  Summary:
25776  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
25777  Description:
25778  This function identifies whether the FIFOInterruptMode feature is available
25779  on the SPI module.
25780  When this function returns true, this function is supported on the device:
25781  - PLIB_SPI_FIFOInterruptModeSelect
25782  This operation is atomic.
25783  Preconditions:
25784  None.
25785  Parameters:
25786  index - Identifier for the device instance
25787  Returns:
25788  - true - The FIFOInterruptMode feature is supported on the device
25789  - false - The FIFOInterruptMode feature is not supported on the device
25790  Remarks:
25791  None.
25792 */
25793 
25794 bool
25796  SPI_MODULE_ID index ) ;
25797 //******************************************************************************
25798 /* Function:
25799  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
25800  Summary:
25801  Identifies whether the FramedCommunication feature exists on the SPI module.
25802  Description:
25803  This function identifies whether the FramedCommunication feature is available
25804  on the SPI module.
25805  When this function returns true, these functions are supported on the device:
25806  - PLIB_SPI_FramedCommunicationEnable
25807  - PLIB_SPI_FramedCommunicationDisable
25808  This operation is atomic.
25809  Preconditions:
25810  None.
25811  Parameters:
25812  index - Identifier for the device instance
25813  Returns:
25814  - true - The FramedCommunication feature is supported on the device
25815  - false - The FramedCommunication feature is not supported on the device
25816  Remarks:
25817  None.
25818 */
25819 
25820 bool
25822  SPI_MODULE_ID index ) ;
25823 //******************************************************************************
25824 /* Function:
25825  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
25826  Summary:
25827  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
25828  Description:
25829  This function identifies whether the FrameSyncPulseDirection feature is available
25830  on the SPI module.
25831  When this function returns true, this function is supported on the device:
25832  - PLIB_SPI_FrameSyncPulseDirectionSelect
25833  This operation is atomic.
25834  Preconditions:
25835  None.
25836  Parameters:
25837  index - Identifier for the device instance
25838  Returns:
25839  - true - The FrameSyncPulseDirection feature is supported on the device
25840  - false - The FrameSyncPulseDirection feature is not supported on the device
25841  Remarks:
25842  None.
25843 */
25844 
25845 bool
25847  SPI_MODULE_ID index ) ;
25848 //******************************************************************************
25849 /* Function:
25850  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
25851  Summary:
25852  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
25853  Description:
25854  This function identifies whether the FrameSyncPulsePolarity feature is available
25855  on the SPI module.
25856  When this function returns true, this function is supported on the device:
25857  - PLIB_SPI_FrameSyncPulsePolaritySelect
25858  This operation is atomic.
25859  Preconditions:
25860  None.
25861  Parameters:
25862  index - Identifier for the device instance
25863  Returns:
25864  - true - The FrameSyncPulsePolarity feature is supported on the device
25865  - false - The FrameSyncPulsePolarity feature is not supported on the device
25866  Remarks:
25867  None.
25868 */
25869 
25870 bool
25872  SPI_MODULE_ID index ) ;
25873 //******************************************************************************
25874 /* Function:
25875  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
25876  Summary:
25877  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
25878  Description:
25879  This function identifies whether the FrameSyncPulseEdge feature is available
25880  on the SPI module.
25881  When this function returns true, this function is supported on the device:
25882  - PLIB_SPI_FrameSyncPulseEdgeSelect
25883  This operation is atomic.
25884  Preconditions:
25885  None.
25886  Parameters:
25887  index - Identifier for the device instance
25888  Returns:
25889  - true - The FrameSyncPulseEdge feature is supported on the device
25890  - false - The FrameSyncPulseEdge feature is not supported on the device
25891  Remarks:
25892  None.
25893 */
25894 
25895 bool
25897  SPI_MODULE_ID index ) ;
25898 //******************************************************************************
25899 /* Function:
25900  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
25901  Summary:
25902  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
25903  Description:
25904  This function identifies whether the FrameSyncPulseWidth feature is available
25905  on the SPI module.
25906  When this function returns true, this function is supported on the device:
25907  - PLIB_SPI_FrameSyncPulseWidthSelect
25908  This operation is atomic.
25909  Preconditions:
25910  None.
25911  Parameters:
25912  index - Identifier for the device instance
25913  Returns:
25914  - true - The FrameSyncPulseWidth feature is supported on the device
25915  - false - The FrameSyncPulseWidth feature is not supported on the device
25916  Remarks:
25917  None.
25918 */
25919 
25920 bool
25922  SPI_MODULE_ID index ) ;
25923 //******************************************************************************
25924 /* Function:
25925  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
25926  Summary:
25927  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
25928  Description:
25929  This function identifies whether the FrameSyncPulseCounter feature is available
25930  on the SPI module.
25931  When this function returns true, this function is supported on the device:
25932  - PLIB_SPI_FrameSyncPulseCounterSelect
25933  This operation is atomic.
25934  Preconditions:
25935  None.
25936  Parameters:
25937  index - Identifier for the device instance
25938  Returns:
25939  - true - The FrameSyncPulseCounter feature is supported on the device
25940  - false - The FrameSyncPulseCounter feature is not supported on the device
25941  Remarks:
25942  None.
25943 */
25944 
25945 bool
25947  SPI_MODULE_ID index ) ;
25948 //******************************************************************************
25949 /* Function:
25950  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
25951  Summary:
25952  Identifies whether the FrameErrorStatus feature exists on the SPI module.
25953  Description:
25954  This function identifies whether the FrameErrorStatus feature is available on
25955  the SPI module.
25956  When this function returns true, these functions are supported on the device:
25957  - PLIB_SPI_FrameErrorStatusGet
25958  - PLIB_SPI_FrameErrorStatusClear
25959  This operation is atomic.
25960  Preconditions:
25961  None.
25962  Parameters:
25963  index - Identifier for the device instance
25964  Returns:
25965  - true - The FrameErrorStatus feature is supported on the device
25966  - false - The FrameErrorStatus feature is not supported on the device
25967  Remarks:
25968  None.
25969 */
25970 
25971 bool
25973  SPI_MODULE_ID index ) ;
25974 //******************************************************************************
25975 /* Function:
25976  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
25977  Summary:
25978  Identifies whether the Buffer feature exists on the SPI module.
25979  Description:
25980  This function identifies whether the Buffer feature is available on the SPI module.
25981  When this function returns true, these functions are supported on the device:
25982  - PLIB_SPI_BufferClear
25983  - PLIB_SPI_BufferRead
25984  - PLIB_SPI_BufferWrite
25985  - PLIB_SPI_BufferAddressGet
25986  This operation is atomic.
25987  Preconditions:
25988  None.
25989  Parameters:
25990  index - Identifier for the device instance
25991  Returns:
25992  - true - The Buffer feature is supported on the device
25993  - false - The Buffer feature is not supported on the device
25994  Remarks:
25995  None.
25996 */
25997 
25998 bool
26000  SPI_MODULE_ID index ) ;
26001 //******************************************************************************
26002 /* Function:
26003  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
26004  Summary:
26005  Identifies whether the BaudRateClock feature exists on the SPI module.
26006  Description:
26007  This function identifies whether the BaudRateClock feature is available on
26008  the SPI module.
26009  When this function returns true, this function is supported on the device:
26010  - PLIB_SPI_BaudRateClockSelect
26011  This operation is atomic.
26012  Preconditions:
26013  None.
26014  Parameters:
26015  index - Identifier for the device instance
26016  Returns:
26017  - true - The BaudRateClock feature is supported on the device
26018  - false - The BaudRateClock feature is not supported on the device
26019  Remarks:
26020  None.
26021 */
26022 
26023 bool
26025  SPI_MODULE_ID index ) ;
26026 //******************************************************************************
26027 /* Function:
26028  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
26029  Summary:
26030  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
26031  Description:
26032  This function identifies whether the ErrorInterruptControl feature is available
26033  on the SPI module.
26034  When this function returns true, these functions are supported on the device:
26035  - PLIB_SPI_ErrorInterruptEnable
26036  - PLIB_SPI_ErrorInterruptDisable
26037  This operation is atomic.
26038  Preconditions:
26039  None.
26040  Parameters:
26041  index - Identifier for the device instance
26042  Returns:
26043  - true - The ErrorInterruptControl feature is supported on the device
26044  - false - The ErrorInterruptControl feature is not supported on the device
26045  Remarks:
26046  None.
26047 */
26048 
26049 bool
26051  SPI_MODULE_ID index ) ;
26052 //******************************************************************************
26053 /* Function:
26054  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
26055  Summary:
26056  Identifies whether the AudioErrorControl feature exists on the SPI module.
26057  Description:
26058  This function identifies whether the AudioErrorControl feature is available
26059  on the SPI module.
26060  When this function returns true, these functions are supported on the device:
26061  - PLIB_SPI_AudioErrorEnable
26062  - PLIB_SPI_AudioErrorDisable
26063  This operation is atomic.
26064  Preconditions:
26065  None.
26066  Parameters:
26067  index - Identifier for the device instance
26068  Returns:
26069  - true - The AudioErrorControl feature is supported on the device
26070  - false - The AudioErrorControl feature is not supported on the device
26071  Remarks:
26072  None.
26073 */
26074 
26075 bool
26077  SPI_MODULE_ID index ) ;
26078 //******************************************************************************
26079 /* Function:
26080  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
26081  Summary:
26082  Identifies whether the AudioProtocolControl feature exists on the SPI module.
26083  Description:
26084  This function identifies whether the AudioProtocolControl feature is available
26085  on the SPI module.
26086  When this function returns true, this function is supported on the device:
26087  - PLIB_SPI_AudioProtocolEnable
26088  - PLIB_SPI_AudioProtocolDisable
26089  This operation is atomic.
26090  Preconditions:
26091  None.
26092  Parameters:
26093  index - Identifier for the device instance
26094  Returns:
26095  - true - The AudioProtocolControl feature is supported on the device
26096  - false - The AudioProtocolControl feature is not supported on the device
26097  Remarks:
26098  None.
26099 */
26100 
26101 bool
26103  SPI_MODULE_ID index ) ;
26104 //******************************************************************************
26105 /* Function:
26106  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26107  Summary:
26108  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26109  Description:
26110  This function identifies whether the AudioTransmitMode feature is available
26111  on the SPI module.
26112  When this function returns true, this function is supported on the device:
26113  - PLIB_SPI_AudioTransmitModeSelect
26114  This operation is atomic.
26115  Preconditions:
26116  None.
26117  Parameters:
26118  index - Identifier for the device instance
26119  Returns:
26120  - true - The AudioTransmitMode feature is supported on the device
26121  - false - The AudioTransmitMode feature is not supported on the device
26122  Remarks:
26123  None.
26124 */
26125 
26126 bool
26128  SPI_MODULE_ID index ) ;
26129 //******************************************************************************
26130 /* Function:
26131  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26132  Summary:
26133  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26134  Description:
26135  This function identifies whether the AudioProtocolMode feature is available
26136  on the SPI module.
26137  When this function returns true, this function is supported on the device:
26138  - PLIB_SPI_AudioProtocolModeSelect
26139  This operation is atomic.
26140  Preconditions:
26141  None.
26142  Parameters:
26143  index - Identifier for the device instance
26144  Returns:
26145  - true - The AudioProtocolMode feature is supported on the device
26146  - false - The AudioProtocolMode feature is not supported on the device
26147  Remarks:
26148  None.
26149 */
26150 
26151 bool
26153  SPI_MODULE_ID index ) ;
26154 //******************************************************************************
26155 /* Function:
26156  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26157  Summary:
26158  Identifies whether the Buffer32bit feature exists on the SPI module.
26159  Description:
26160  This function identifies whether the Buffer32bit feature is available on the
26161  SPI module.
26162  When this function returns true, these functions are supported on the device:
26163  - PLIB_SPI_BufferRead32bit
26164  - PLIB_SPI_BufferWrite32bit
26165  This operation is atomic.
26166  Preconditions:
26167  None.
26168  Parameters:
26169  index - Identifier for the device instance
26170  Returns:
26171  - true - The Buffer32bit feature is supported on the device
26172  - false - The Buffer32bit feature is not supported on the device
26173  Remarks:
26174  None.
26175 */
26176 
26177 bool
26179  SPI_MODULE_ID index ) ;
26180 //******************************************************************************
26181 /* Function:
26182  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26183  Summary:
26184  Identifies whether the Buffer16bit feature exists on the SPI module.
26185  Description:
26186  This function identifies whether the Buffer16bit feature is available on the
26187  SPI module.
26188  When this function returns true, these functions are supported on the device:
26189  - PLIB_SPI_BufferRead16bit
26190  - PLIB_SPI_BufferWrite16bit
26191  This operation is atomic.
26192  Preconditions:
26193  None.
26194  Parameters:
26195  index - Identifier for the device instance
26196  Returns:
26197  - true - The Buffer16bit feature is supported on the device
26198  - false - The Buffer16bit feature is not supported on the device
26199  Remarks:
26200  None.
26201 */
26202 
26203 bool
26205  SPI_MODULE_ID index ) ;
26206 //DOM-IGNORE-BEGIN
26207 //DOM-IGNORE-END
26208  // #ifndef _PLIB_SPI_H
26209 /*******************************************************************************
26210  End of File
26211  */
26212 
26213 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26214 /* CLOSE_FILE Include File */
26215 
26216  // SPI PLIB Header
26217 #include "system/common/sys_common.h" // Common System Service Definitions
26218 #include "system/common/sys_module.h" // Module/Driver Definitions
26219 #include "system/int/sys_int.h" // System Interrupt Definitions
26220 #include "system/clk/sys_clk.h"
26221 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26222  /* LDRA full path */
26223 // DOM-IGNORE-BEGIN
26224 // DOM-IGNORE-END
26225 // *****************************************************************************
26226 /* SPI Driver Buffer Handle
26227  Summary:
26228  Handle identifying a read or write buffer passed to the driver.
26229  Description:
26230  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26231  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26232  This handle is associated with the buffer passed into the function and
26233  it allows the application to track the completion of the data from (or into)
26234  that buffer. The buffer handle value returned from the "buffer add" function
26235  is returned back to the client by the "callback" function registered with
26236  the driver.
26237  The buffer handle assigned to a client request expires when the client has
26238  been notified of the completion of the buffer transfer (after event handler
26239  function that notifies the client returns) or after the buffer has been
26240  retired by the driver if no event handler callback was set.
26241  Remarks:
26242  None.
26243 */
26244 
26245 typedef
26246 uintptr_t
26248 // *****************************************************************************
26249 /* SPI Driver Invalid Buffer Handle
26250  Summary:
26251  Definition of an invalid buffer handle.
26252  Description:
26253  This is the definition of an invalid buffer handle. An invalid buffer handle
26254  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26255  function if the buffer add request was not successful.
26256  Remarks:
26257  None.
26258 */
26259 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26260 // *****************************************************************************
26261 /* SPI Driver Module Index Numbers
26262  Summary:
26263  SPI driver index definitions.
26264  Description:
26265  These constants provide the SPI driver index definitions.
26266  Remarks:
26267  These constants should be used in place of hard-coded numeric literals.
26268  These values should be passed into the DRV_SPI_Initialize and
26269  DRV_SPI_Open functions to identify the driver instance in use.
26270 */
26271 #define DRV_SPI_INDEX_0 0
26272 #define DRV_SPI_INDEX_1 1
26273 #define DRV_SPI_INDEX_2 2
26274 #define DRV_SPI_INDEX_3 3
26275 #define DRV_SPI_INDEX_4 4
26276 #define DRV_SPI_INDEX_5 5
26277 // *****************************************************************************
26278 /* SPI Driver Module Index Count
26279  Summary:
26280  Number of valid SPI driver indices.
26281  Description:
26282  This constant identifies the number of valid SPI driver indices.
26283  Remarks:
26284  This constant should be used in place of hard-coded numeric literals.
26285  This value is derived from device-specific header files defined as part
26286  of the peripheral libraries.
26287 */
26288 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26289 // *****************************************************************************
26290 /* SPI Clock Mode Selection
26291  Summary:
26292  Identifies the various clock modes of the SPI module.
26293  Description:
26294  This enumeration identifies the various clock modes of the SPI module.
26295  Remarks:
26296  None.
26297 */
26298 
26299 typedef
26300  enum
26301  {
26302  /* SPI Clock Mode 0:
26303  - Idle State of the clock is Low
26304  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26305  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26307  /*DOM-IGNORE-BEGIN*/
26308  = 0 /*DOM-IGNORE-END*/
26309  ,
26310  /* SPI Clock Mode 1:
26311  - Idle State of the clock is Low
26312  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26313  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26315  /*DOM-IGNORE-BEGIN*/
26316  = 1 /*DOM-IGNORE-END*/
26317  ,
26318  /* SPI Clock Mode 2:
26319  - Idle State of the clock is High
26320  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26321  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26323  /*DOM-IGNORE-BEGIN*/
26324  = 2 /*DOM-IGNORE-END*/
26325  ,
26326  /* SPI Clock Mode 3:
26327  - Idle State of the clock is High
26328  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26329  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26331  /*DOM-IGNORE-BEGIN*/
26332  = 3 /*DOM-IGNORE-END*/
26333  } DRV_SPI_CLOCK_MODE ;
26334 // *****************************************************************************
26335 /* SPI Buffer Type Selection
26336  Summary:
26337  Identifies the various buffer types of the SPI module.
26338  Description:
26339  This enumeration identifies the various buffer types of the SPI module.
26340  Remarks:
26341  None.
26342 */
26343 
26344 typedef
26345  enum
26346  {
26347  /* SPI Buffer Type Standard */
26349  /*DOM-IGNORE-BEGIN*/
26350  = 0 /*DOM-IGNORE-END*/
26351  ,
26352  /* SPI Enhanced Buffer Type */
26354  /*DOM-IGNORE-BEGIN*/
26355  = 1 /*DOM-IGNORE-END*/
26357 // *****************************************************************************
26358 /* SPI Protocols Enumeration
26359  Summary:
26360  Identifies the various protocols of the SPI module.
26361  Description:
26362  This enumeration identifies the various protocols of the SPI module.
26363  Remarks:
26364  None.
26365 */
26366 
26367 typedef
26368  enum
26369  {
26370  /* SPI Protocol Type Standard */
26372  /*DOM-IGNORE-BEGIN*/
26373  = 0 /*DOM-IGNORE-END*/
26374  ,
26375  /* SPI Protocol Type Framed */
26377  /*DOM-IGNORE-BEGIN*/
26378  = 1 /*DOM-IGNORE-END*/
26379  ,
26380  /*SPI Protocol Type Audio*/
26382  /*DOM-IGNORE-BEGIN*/
26383  = 2 /*DOM-IGNORE-END*/
26385 // *****************************************************************************
26386 /* SPI Driver Buffer Events
26387  Summary
26388  Identifies the possible events that can result from a buffer add request.
26389  Description
26390  This enumeration identifies the possible events that can result from a
26391  buffer add request caused by the client calling either
26392  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26393  Remarks:
26394  One of these values is passed in the "event" parameter of the event
26395  handling callback function that the client registered during buffer add
26396  requests.
26397 */
26398 
26399 typedef
26400  enum
26401  {
26402  /* Buffer is pending to get processed */
26404  /* Buffer is being processed */
26406  /* All data from or to the buffer was transferred successfully. */
26408  /* There was an error while processing the buffer transfer request. */
26411 // *****************************************************************************
26412 /* SPI Usage Modes Enumeration
26413  Summary:
26414  Identifies the various usage modes of the SPI module.
26415  Description:
26416  This enumeration identifies the various usage modes of the SPI module.
26417  Remarks:
26418  None.
26419 */
26420 
26421 typedef
26422  enum
26423  {
26424  /* SPI Mode Master */
26426  /*DOM-IGNORE-BEGIN*/
26427  = 0 /*DOM-IGNORE-END*/
26428  ,
26429  /* SPI Mode Slave */
26431  /*DOM-IGNORE-BEGIN*/
26432  = 1 /*DOM-IGNORE-END*/
26433  } DRV_SPI_MODE ;
26434 // *****************************************************************************
26435 /* SPI Task Modes Enumeration
26436  Summary:
26437  Identifies the various modes of how the tasks function will be run.
26438  Description:
26439  This enumeration identifies the various tasks mode
26440  Remarks:
26441  None.
26442 */
26443 
26444 typedef
26445  enum
26446  {
26447  /* Task is configured to run in polled mode */
26449  /*DOM-IGNORE-BEGIN*/
26450  = 0 /*DOM-IGNORE-END*/
26451  ,
26452  /* Task is configured to run in interrupt mode */
26454  /*DOM-IGNORE-BEGIN*/
26455  = 1 /*DOM-IGNORE-END*/
26456  } DRV_SPI_TASK_MODE ;
26457 // *****************************************************************************
26458 /* SPI Driver Buffer Event Handler Function Pointer
26459  Summary:
26460  Pointer to a SPI Driver Buffer Event handler function
26461  Description:
26462  This data type defines the required function signature for the SPI driver
26463  buffer event handling callback function. A client must register a pointer
26464  to a buffer event handling function who's function signature (parameter
26465  and return value types) match the types specified by this function pointer
26466  in order to receive buffer related event calls back from the driver.
26467  The parameters and return values and return value are described here and
26468  a partial example implementation is provided.
26469  Parameters:
26470  event - Identifies the type of event
26471  bufferHandle - Handle identifying the buffer to which the vent relates
26472  context - Value identifying the context of the application that
26473  registered the event handling function.
26474  Returns:
26475  None.
26476  Example:
26477  <code>
26478  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26479  DRV_SPI_BUFFER_HANDLE bufferHandle,
26480  uintptr_t context )
26481  {
26482  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26483  switch(event)
26484  {
26485  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26486  // Handle the completed buffer.
26487  break;
26488  case DRV_SPI_BUFFER_EVENT_ERROR:
26489  default:
26490  // Handle error.
26491  break;
26492  }
26493  }
26494  </code>
26495  Remarks:
26496  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26497  transferred successfully.
26498  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26499  not transferred successfully.
26500  The bufferHandle parameter contains the buffer handle of the buffer that
26501  failed.
26502  The context parameter contains the a handle to the client context,
26503  provided at the time the event handling function registration.
26504  This context handle value is passed back to the client as the "context"
26505  parameter. It can be any value necessary to identify the client context
26506  or instance (such as a pointer to the client's data) instance of the
26507  client that made the buffer add request.
26508  The event handler function executes in an interrupt context when the driver
26509  is configured for interrupt mode operation. It is recommended of the
26510  application to not perform process intensive operations with in this
26511  function.
26512 */
26513 
26514 typedef
26516 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26517 void * context ) ;
26518 // *****************************************************************************
26519 /* SPI Driver Initialization Data
26520  Summary:
26521  Defines the data required to initialize or reinitialize the SPI driver
26522  Description:
26523  This data type defines the data required to initialize or reinitialize the
26524  SPI driver. If the driver is built statically, the members of this data
26525  structure are statically over-ridden by static override definitions in the
26526  system_config.h file.
26527  Remarks:
26528  None.
26529 */
26530 
26531 typedef
26532 struct _DRV_SPI_INIT
26533 {
26534  /* System module initialization */
26535  SYS_MODULE_INIT moduleInit ;
26536  /* Identifies peripheral (PLIB-level) ID */
26537  SPI_MODULE_ID spiId ;
26538  /* SPI Task Mode Type*/
26540  /* SPI Usage Mode Type */
26542  /* Allow SPI to run when CPU goes to idle mode*/
26544  /* SPI Protocol Type */
26546  /* SPI Slave Mode SSx Pin Select */
26548  /* Framed mode Sync Pulse*/
26549  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26550  /* Framed Mode pulse polarity*/
26551  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26552  /* Framed Mode Pulse Direction*/
26553  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26554  /* Framed mode Pulse Edge*/
26555  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26556  /* Framed Mode Pulse width */
26557  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26558  /* Audio mode transmit mode*/
26559  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26560  /* Audio mode protocol mode*/
26561  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26562  /* Communication Width */
26563  SPI_COMMUNICATION_WIDTH commWidth ;
26564  /* SPI clock source which generates required baud rate.
26565  It can be either PBCLK or Reference Clock */
26566  SPI_BAUD_RATE_CLOCK baudClockSource ;
26567  /* when Baud rate clock source is peripheral clock, then this element is
26568  used to define which peripheral bus clock is used for this particular
26569  SPI instance. */
26570  CLK_BUSES_PERIPHERAL spiClk ;
26571  /* Baud Rate Value */
26572  uint32_t baudRate ;
26573  /* SPI Buffer Type */
26575  /* SPI Clock mode */
26577  /* SPI Input Sample Phase Selection */
26578  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26579  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26580  INT_SOURCE txInterruptSource ;
26581  /* Receive Interrupt Source for SPI module */
26582  INT_SOURCE rxInterruptSource ;
26583  /* Error Interrupt Source for SPI module */
26584  INT_SOURCE errInterruptSource ;
26585  /* While using standard buffer and polled mode how many transfers to do
26586  before yielding to other tasks*/
26588  /* Dummy byte value which will be used for dummy transmission */
26589  uint32_t dummyByteValue ;
26590  /* This is the buffer queue size. This is the maximum
26591  number of transfer requests that driver will queue. */
26592  uint8_t queueSize ;
26593  /* This controls the minimum number of jobs that the driver will be able
26594  to accept without running out of memory. The driver will reserve this
26595  number of jobs from the global SPI queue so that it will always be available*/
26597  /* This callback is fired when an operation is about to start on the
26598  SPI bus. This allows the user to set any pins that need to be set.
26599  This callback may be called from an ISR so should not include OSAL
26600  calls. The context parameter is the same one passed into the
26601  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26602  */
26604  /* This callback is fired when an operation has just completed on the
26605  SPI bus. This allows the user to set any pins that need to be set.
26606  This callback may be called from an ISR so should not include OSAL
26607  calls. The context parameter is the same one passed into the
26608  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26609  */
26611 } DRV_SPI_INIT ;
26612 // *****************************************************************************
26613 /* SPI Driver Client Specific Configuration
26614  Summary:
26615  Defines the data that can be changed per client.
26616  Description:
26617  This data type defines the data can be configured per client. This data can
26618  be per client, and overrides the configuration data contained inside of
26619  DRV_SPI_INIT.
26620  Remarks:
26621  None.
26622 */
26623 
26624 typedef
26625 struct _DRV_SPI_CLIENT_DATA
26626 {
26627  /* Baud Rate Value */
26628  uint32_t baudRate ;
26629  /* This callback is fired when an operation is about to start on the
26630  SPI bus. This allows the user to set any pins that need to be set.
26631  This callback may be called from an ISR so should not include OSAL
26632  calls. The context parameter is the same one passed into the
26633  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26634  */
26636  /* This callback is fired when an operation has just completed on the
26637  SPI bus. This allows the user to set any pins that need to be set.
26638  This callback may be called from an ISR so should not include OSAL
26639  calls. The context parameter is the same one passed into the
26640  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26641  */
26644 //DOM-IGNORE-BEGIN
26645 //DOM-IGNORE-END
26646  // #ifndef _DRV_SPI_DEFINITIONS_H
26647 /*******************************************************************************
26648  End of File
26649 */
26650 
26651 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
26652 /* CLOSE_FILE Include File */
26653 
26654 // DOM-IGNORE-BEGIN
26655 // DOM-IGNORE-END
26656 // *****************************************************************************
26657 // *****************************************************************************
26658 // Section: Interface Routines - System Level
26659 // *****************************************************************************
26660 // *****************************************************************************
26661 // *****************************************************************************
26662 /* Function:
26663  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
26664  const SYS_MODULE_INIT * const init )
26665  Summary:
26666  Initializes the SPI instance for the specified driver index.
26667  <p><b>Implementation:</b> Static/Dynamic</p>
26668  Description:
26669  This routine initializes the SPI driver instance for the specified driver
26670  index, making it ready for clients to open and use it. The initialization
26671  data is specified by the 'init' parameter. The initialization may fail if the
26672  number of driver objects allocated are insufficient or if the specified
26673  driver instance is already initialized. The driver instance index is
26674  independent of the SPI module ID. For example, driver instance 0 can be
26675  assigned to SPI2. If the driver is built statically, then some of the
26676  initialization parameters are overridden by configuration macros. Refer to
26677  the description of the DRV_SPI_INIT data structure for more details on
26678  which members on this data structure are overridden.
26679  Precondition:
26680  None.
26681  Parameters:
26682  index - Identifier for the instance to be initialized. Please note this
26683  is not the SPI id. The hardware SPI id is set in the initialization
26684  structure. This is the index of the driver index to use.
26685  init - Pointer to a data structure containing any data necessary to
26686  initialize the driver. If this pointer is NULL, the driver
26687  uses the static initialization override macros for each
26688  member of the initialization data structure.
26689  Returns:
26690  - If successful - returns a valid handle to a driver instance object
26691  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
26692  Example:
26693  <code>
26694  DRV_SPI_INIT init;
26695  SYS_MODULE_OBJ objectHandle;
26696  // Populate the SPI initialization structure
26697  init.spiId = SPI_ID_1,
26698  init.taskMode = DRV_SPI_TASK_MODE_ISR,
26699  init.spiMode = DRV_SPI_MODE_MASTER,
26700  init.allowIdleRun = false,
26701  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
26702  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
26703  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
26704  init.spiClk = CLK_BUS_PERIPHERAL_2,
26705  init.baudRate = 10000000,
26706  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
26707  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
26708  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
26709  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
26710  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
26711  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
26712  init.dummyByteValue = 0xFF,
26713  init.queueSize = 10,
26714  init.jobQueueReserveSize = 1,
26715  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
26716  if (SYS_MODULE_OBJ_INVALID == objectHandle)
26717  {
26718  // Handle error
26719  }
26720  </code>
26721  Remarks:
26722  This routine must be called before any other SPI routine is called.
26723  This routine should only be called once during system initialization
26724  unless DRV_SPI_Deinitialize is called to deinitialize the driver
26725  instance. This routine will NEVER block for hardware access.
26726 */
26727 
26728 SYS_MODULE_OBJ
26730  const SYS_MODULE_INDEX index ,
26731  const SYS_MODULE_INIT * const init ) ;
26732 //*************************************************************************
26733 /* Function:
26734  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
26735  Summary:
26736  Deinitializes the specified instance of the SPI driver module.
26737  <p><b>Implementation:</b> Static/Dynamic</p>
26738  Description:
26739  Deinitializes the specified instance of the SPI driver module,
26740  disabling its operation (and any hardware) and invalidates all of the
26741  internal data.
26742  Precondition:
26743  Function DRV_SPI_Initialize must have been called before calling this
26744  routine and a valid SYS_MODULE_OBJ must have been returned.
26745  Parameters:
26746  object - Driver object handle, returned from DRV_SPI_Initialize
26747  Returns:
26748  None.
26749  Example:
26750  <code>
26751  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26752  SYS_STATUS status;
26753  DRV_SPI_Deinitialize ( object );
26754  status = DRV_SPI_Status( object );
26755  if( SYS_MODULE_UNINITIALIZED == status )
26756  {
26757  // Check again later if you need to know
26758  // when the driver is deinitialized.
26759  }
26760  </code>
26761  Remarks:
26762  Once the Initialize operation has been called, the De-initialize
26763  operation must be called before the Initialize operation can be called
26764  again.
26765  This function will NEVER block waiting for hardware. If the operation
26766  requires time to allow the hardware to complete, this will be reported
26767  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
26768  to find out when the module is in the ready state.
26769 */
26770 
26771 void
26773  SYS_MODULE_OBJ object ) ;
26774 //**************************************************************************
26775 /* Function:
26776  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
26777  Summary:
26778  Provides the current status of the SPI driver module.
26779  <p><b>Implementation:</b> Static/Dynamic</p>
26780  Description:
26781  This function provides the current status of the SPI driver module.
26782  Precondition:
26783  The DRV_SPI_Initialize function must have been called before calling
26784  this function.
26785  Parameters:
26786  object - Driver object handle, returned from DRV_SPI_Initialize
26787  Returns:
26788  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
26789  system level operation and cannot start another
26790  Example:
26791  <code>
26792  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26793  SYS_STATUS status;
26794  status = DRV_SPI_Status( object );
26795  if( SYS_STATUS_READY != status )
26796  {
26797  // Handle error
26798  }
26799  </code>
26800  Remarks:
26801  Any value greater than SYS_STATUS_READY is also a normal running state
26802  in which the driver is ready to accept new operations.
26803  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
26804  deinitialized
26805  This value is less than SYS_STATUS_ERROR.
26806  This function can be used to determine when any of the driver's module
26807  level operations has completed.
26808  If the status operation returns SYS_STATUS_BUSY, the previous operation
26809  has not yet completed. Once the status operation returns
26810  SYS_STATUS_READY, any previous operations have completed.
26811  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
26812  that is also an error state.
26813  This function will NEVER block waiting for hardware.
26814  If the Status operation returns an error value, the error may be
26815  cleared by calling the reinitialize operation. If that fails, the
26816  deinitialize operation will need to be called, followed by the
26817  initialize operation to return to normal operations.
26818 */
26819 
26820 SYS_STATUS
26821  DRV_SPI_Status (
26822  SYS_MODULE_OBJ object ) ;
26823 // *****************************************************************************
26824 /* Function:
26825  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
26826  Summary:
26827  Maintains the driver's state machine and implements its ISR.
26828  <p><b>Implementation:</b> Static/Dynamic</p>
26829  Description:
26830  This routine is used to maintain the driver's internal state
26831  machine and implement its transmit ISR for interrupt-driven implementations.
26832  In polling mode, this function should be called from the SYS_Tasks()
26833  function. In interrupt mode, this function should be called in the transmit
26834  interrupt service routine of the USART that is associated with this USART
26835  driver hardware instance.
26836  Precondition:
26837  The DRV_SPI_Initialize routine must have been called for the specified
26838  SPI driver instance.
26839  Parameters:
26840  object - Object handle for the specified driver instance (returned from
26841  DRV_SPI_Initialize)
26842  Returns:
26843  None.
26844  Example:
26845  <code>
26846  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26847  while( true )
26848  {
26849  DRV_SPI_Tasks ( object );
26850  // Do other tasks
26851  }
26852  </code>
26853  Remarks:
26854  This function is normally not called directly by an application. It is
26855  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
26856  ISR.
26857  This function may execute in an ISR context and will never block or access any
26858  resources that may cause it to block.
26859 */
26860 
26861 void
26862  DRV_SPI_Tasks (
26863  SYS_MODULE_OBJ object ) ;
26864 // *****************************************************************************
26865 // *****************************************************************************
26866 // Section: Interface Routines - Client Level
26867 // *****************************************************************************
26868 // *****************************************************************************
26869 //**************************************************************************
26870 /* Function:
26871  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
26872  const DRV_IO_INTENT ioIntent )
26873  Summary:
26874  Opens the specified SPI driver instance and returns a handle to it.
26875  <p><b>Implementation:</b> Static/Dynamic</p>
26876  Description:
26877  This routine opens the specified SPI driver instance and provides a
26878  handle that must be provided to all other client-level operations to
26879  identify the caller and the instance of the driver. The ioIntent
26880  parameter defines how the client interacts with this driver instance.
26881  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
26882  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
26883  able to write to the driver. If the ioIntent in
26884  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
26885  write.
26886  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
26887  exclusive access to this client. The driver cannot be opened by any
26888  other client.
26889  Precondition:
26890  The DRV_SPI_Initialize function must have been called before calling
26891  this function.
26892  Parameters:
26893  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
26894  Please note this is not the SPI ID.
26895  ioIntent - Zero or more of the values from the enumeration
26896  DRV_IO_INTENT ORed together to indicate the intended use of
26897  the driver
26898  Returns:
26899  If successful, the routine returns a valid open-instance handle (a
26900  number identifying both the caller and the module instance).
26901  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
26902  can occur when the following is true:
26903  * if the number of client objects allocated via
26904  DRV_SPI_INSTANCES_NUMBER is insufficient
26905  * if the client is trying to open the driver but driver has been
26906  opened exclusively by another client
26907  * if the driver hardware instance being opened is not initialized or
26908  is invalid
26909  Example:
26910  <code>
26911  DRV_HANDLE handle;
26912  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
26913  if( DRV_HANDLE_INVALID == handle )
26914  {
26915  // Unable to open the driver
26916  }
26917  </code>
26918  Remarks:
26919  The handle returned is valid until the DRV_SPI_Close routine is
26920  called. This routine will NEVER block waiting for hardware. If the
26921  requested intent flags are not supported, the routine will return
26922  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
26923  It should not be called in an ISR.
26924 */
26925 
26926 DRV_HANDLE
26927  DRV_SPI_Open (
26928  const SYS_MODULE_INDEX drvIndex ,
26929  const DRV_IO_INTENT ioIntent ) ;
26930 //**************************************************************************
26931 /* Function:
26932  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
26933  const DRV_SPI_CLIENT_DATA * cfgData )
26934  Summary:
26935  Configures a SPI client with specific data.
26936  <p><b>Implementation:</b> Static/Dynamic</p>
26937  Description:
26938  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
26939  Whenever a new SPI job is started these values will be used. Passing in NULL will
26940  reset the client back to configuration parameters passed to driver initialization.
26941  A zero in any of the structure elements will reset that specific configuration back
26942  to the driver default.
26943  Precondition:
26944  The DRV_SPI_Open function must have been called before calling
26945  this function.
26946  Parameters:
26947  handle - handle of the client returned by DRV_SPI_Open.
26948  cfgData - Client-specific configuration data.
26949  Returns:
26950  - If successful - the routing will return greater than or equal to zero
26951  - If an error occurs - the return value is negative
26952 */
26953 
26954 int32_t
26956  DRV_HANDLE handle ,
26957  const DRV_SPI_CLIENT_DATA * cfgData ) ;
26958 // *****************************************************************************
26959 /* Function:
26960  void DRV_SPI_Close ( DRV_HANDLE handle )
26961  Summary:
26962  Closes an opened instance of the SPI driver.
26963  <p><b>Implementation:</b> Static/Dynamic</p>
26964  Description:
26965  This function closes an opened instance of the SPI driver, invalidating the
26966  handle.
26967  Precondition:
26968  The DRV_SPI_Initialize routine must have been called for the specified
26969  SPI driver instance.
26970  DRV_SPI_Open must have been called to obtain a valid opened device handle.
26971  Parameters:
26972  handle - A valid open-instance handle, returned from the driver's
26973  open routine
26974  Returns:
26975  None.
26976  Example:
26977  <code>
26978  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26979  DRV_SPI_Close ( handle );
26980  </code>
26981  Remarks:
26982  After calling this routine, the handle passed in "handle" must not be used
26983  with any of the remaining driver routines. A new handle must be obtained by
26984  calling DRV_SPI_Open before the caller may use the driver again. This
26985  function is thread safe in a RTOS application.
26986  Note:
26987  Usually there is no need for the driver client to verify that the Close
26988  operation has completed.
26989 */
26990 
26991 void
26992  DRV_SPI_Close (
26993  DRV_HANDLE handle ) ;
26994 // *****************************************************************************
26995 // *****************************************************************************
26996 // Section: Interface Routines - Client level Read & Write APIs
26997 // *****************************************************************************
26998 // *****************************************************************************
26999 /* These are non-blocking APIs. It doesn't wait until the operation gets
27000  finished. The actual operation will happen it the task routine. The status of
27001  this operation can be monitored using DRV_SPI_BufferStatus function. In
27002  polling mode, User must ensure that the code gets time to execute the task
27003  routine. */
27004 //*******************************************************************************
27005 /* Function:
27006  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
27007  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27008  void * context )
27009  Summary:
27010  Registers a buffer for a read operation. Actual transfer will happen in
27011  the Task function.
27012  <p><b>Implementation:</b> Static/Dynamic</p>
27013  Description:
27014  Registers a buffer for a read operation. Actual transfer will happen in
27015  the Task function. The status of this operation can be monitored using
27016  DRV_SPI_BufferStatus function. A optional callback can also be
27017  provided that will be called when the operation is complete.
27018  Precondition:
27019  The DRV_SPI_Initialize routine must have been called for the specified
27020  SPI driver instance.
27021  DRV_SPI_Open must have been called to obtain a valid opened device
27022  handle.
27023  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27024  in the DRV_SPI_Open call.
27025  Parameters:
27026  handle - A valid open-instance handle, returned from the driver's
27027  open routine
27028  rxBuffer - The buffer to which the data should be written to.
27029  size - Number of bytes to be read from the SPI bus.
27030  completeCB - Pointer to a function to be called when this queued operation is complete.
27031  context - unused by the driver but this is passed to the callback when it is called.
27032  Returns:
27033  If the buffer add request is successful, a valid buffer handle is returned.
27034  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27035  Example:
27036  <code>
27037  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27038  char myBuffer[MY_BUFFER_SIZE], state = 0;
27039  DRV_SPI_BUFFER_HANDLE bufferHandle;
27040  switch ( state )
27041  {
27042  case 0:
27043  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
27044  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27045  {
27046  state++;
27047  }
27048  break;
27049  case 1:
27050  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27051  {
27052  state++;
27053  // All transmitter data has been sent successfully.
27054  }
27055  break;
27056  }
27057  </code>
27058  Remarks:
27059  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
27060  instead of it.
27061  */
27062 
27065  DRV_HANDLE handle ,
27066  void * rxBuffer ,
27067  size_t size ,
27068  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27069  void * context ) ;
27070 //*******************************************************************************
27071 /* Function:
27072  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
27073  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27074  void * context )
27075  Summary:
27076  Registers a buffer for a write operation. Actual transfer will happen
27077  in the Task function.
27078  <p><b>Implementation:</b> Static/Dynamic</p>
27079  Description:
27080  Registers a buffer for a write operation. Actual transfer will happen
27081  in the Task function. The status of this operation can be monitored
27082  using DRV_SPI_BufferStatus function. A optional callback can also be
27083  provided that will be called when the operation is complete.
27084  Precondition:
27085  The DRV_SPI_Initialize routine must have been called for the specified
27086  SPI driver instance.
27087  DRV_SPI_Open must have been called to obtain a valid opened device
27088  handle.
27089  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27090  in the DRV_SPI_Open call.
27091  Parameters:
27092  handle - A valid open-instance handle, returned from the driver's
27093  open routine
27094  txBuffer - The buffer which hold the data.
27095  size - Number of bytes to be written to the SPI bus.
27096  completeCB - Pointer to a function to be called when this queued operation is complete
27097  context - unused by the driver but this is passed to the callback when it is called
27098  Returns:
27099  If the buffer add request is successful, a valid buffer handle is returned.
27100  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27101  Example:
27102  <code>
27103  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27104  char myBuffer[MY_BUFFER_SIZE], state = 0;
27105  DRV_SPI_BUFFER_HANDLE bufferHandle;
27106  switch ( state )
27107  {
27108  case 0:
27109  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27110  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27111  {
27112  state++;
27113  }
27114  break;
27115  case 1:
27116  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27117  {
27118  state++;
27119  // All transmitter data has been sent successfully.
27120  }
27121  break;
27122  }
27123  </code>
27124  Remarks:
27125  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27126  instead of it.
27127 */
27128 
27131  DRV_HANDLE handle ,
27132  void * txBuffer ,
27133  size_t size ,
27134  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27135  void * context ) ;
27136 //*******************************************************************************
27137 /* Function:
27138  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27139  void *txBuffer, void *rxBuffer, size_t size, )
27140  Summary:
27141  Registers a buffer for a read and write operation. Actual transfer will
27142  happen in the Task function.
27143  <p><b>Implementation:</b> Static/Dynamic</p>
27144  Description:
27145  Registers a buffer for a read and write operation. Actual transfer will
27146  happen in the Task function. The status of this operation can be
27147  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27148  provided that will be called when the operation is complete.
27149  Precondition:
27150  The DRV_SPI_Initialize routine must have been called for the specified
27151  SPI driver instance.
27152  DRV_SPI_Open must have been called to obtain a valid opened device
27153  handle.
27154  Parameters:
27155  handle - A valid open-instance handle, returned from the driver's
27156  open routine
27157  txBuffer - The buffer which hold the data.
27158  txSize - Number of bytes to be written to the SPI bus.
27159  rxBuffer - The buffer to which the data should be written to.
27160  rxSize - Number of bytes to be read from the SPI bus
27161  completeCB - Pointer to a function to be called when this queued operation is complete
27162  context - unused by the driver but this is passed to the callback when it is called
27163  Returns:
27164  If the buffer add request is successful, a valid buffer handle is returned.
27165  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27166  Example:
27167  <code>
27168  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27169  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27170  DRV_SPI_BUFFER_HANDLE bufferHandle;
27171  switch ( state )
27172  {
27173  case 0:
27174  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27175  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27176  {
27177  state++;
27178  }
27179  break;
27180  case 1:
27181  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27182  {
27183  state++;
27184  // All transmitter data has been sent successfully.
27185  }
27186  break;
27187  }
27188  </code>
27189  Remarks:
27190  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27191  instead of it.
27192 */
27193 
27196  DRV_HANDLE handle ,
27197  void * txBuffer ,
27198  size_t txSize ,
27199  void * rxBuffer ,
27200  size_t rxSize ,
27201  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27202  void * context ) ;
27203 //*******************************************************************************
27204 /* Function:
27205  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27206  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27207  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27208  Summary:
27209  Registers a buffer for a read operation. Actual transfer will happen in
27210  the Task function.
27211  <p><b>Implementation:</b> Static/Dynamic</p>
27212  Description:
27213  Registers a buffer for a read operation. Actual transfer will happen in
27214  the Task function. The status of this operation can be monitored using
27215  DRV_SPI_BufferStatus function. A optional callback can also be
27216  provided that will be called when the operation is complete.
27217  Precondition:
27218  The DRV_SPI_Initialize routine must have been called for the specified
27219  SPI driver instance.
27220  DRV_SPI_Open must have been called to obtain a valid opened device
27221  handle.
27222  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27223  in the DRV_SPI_Open call.
27224  Parameters:
27225  handle - A valid open-instance handle, returned from the driver's
27226  open routine
27227  rxBuffer - The buffer to which the data should be written to.
27228  size - Number of bytes to be read from the SPI bus.
27229  completeCB - Pointer to a function to be called when this queued operation is complete
27230  context - unused by the driver but this is passed to the callback when it is called
27231  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27232  Returns:
27233  If the buffer add request is successful, a valid buffer handle is returned.
27234  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27235  Example:
27236  <code>
27237  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27238  char myBuffer[MY_BUFFER_SIZE], state = 0;
27239  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27240  switch ( state )
27241  {
27242  case 0:
27243  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27244  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27245  {
27246  state++;
27247  }
27248  break;
27249  case 1:
27250  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27251  {
27252  state++;
27253  // All transmitter data has been sent successfully.
27254  }
27255  break;
27256  }
27257  </code>
27258  Remarks:
27259  None.
27260  */
27261 
27264  DRV_HANDLE handle ,
27265  void * rxBuffer ,
27266  size_t size ,
27267  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27268  void * context ,
27269  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27270 //*******************************************************************************
27271 /* Function:
27272  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27273  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27274  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27275  Summary:
27276  Registers a buffer for a write operation. Actual transfer will happen
27277  in the Task function.
27278  <p><b>Implementation:</b> Static/Dynamic</p>
27279  Description:
27280  Registers a buffer for a write operation. Actual transfer will happen
27281  in the Task function. The status of this operation can be monitored
27282  using DRV_SPI_BufferStatus function. A optional callback can also be
27283  provided that will be called when the operation is complete.
27284  Precondition:
27285  The DRV_SPI_Initialize routine must have been called for the specified
27286  SPI driver instance.
27287  DRV_SPI_Open must have been called to obtain a valid opened device
27288  handle.
27289  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27290  in the DRV_SPI_Open call.
27291  Parameters:
27292  handle - A valid open-instance handle, returned from the driver's
27293  open routine
27294  txBuffer - The buffer which hold the data.
27295  size - Number of bytes to be written to the SPI bus.
27296  completeCB - Pointer to a function to be called when this queued operation is complete
27297  context - unused by the driver but this is passed to the callback when it is called
27298  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27299  Returns:
27300  If the buffer add request is successful, a valid buffer handle is returned.
27301  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27302  Example:
27303  <code>
27304  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27305  char myBuffer[MY_BUFFER_SIZE], state = 0;
27306  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27307  switch ( state )
27308  {
27309  case 0:
27310  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27311  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27312  {
27313  state++;
27314  }
27315  break;
27316  case 1:
27317  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27318  {
27319  state++;
27320  // All transmitter data has been sent successfully.
27321  }
27322  break;
27323  }
27324  </code>
27325  Remarks:
27326  None.
27327 */
27328 
27331  DRV_HANDLE handle ,
27332  void * txBuffer ,
27333  size_t size ,
27334  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27335  void * context ,
27336  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27337 //*******************************************************************************
27338 /* Function:
27339  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27340  void *txBuffer, void *rxBuffer, size_t size,
27341  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27342  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27343  Summary:
27344  Registers a buffer for a read and write operation. Actual transfer will
27345  happen in the Task function.
27346  <p><b>Implementation:</b> Static/Dynamic</p>
27347  Description:
27348  Registers a buffer for a read and write operation. Actual transfer will
27349  happen in the Task function. The status of this operation can be
27350  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27351  provided that will be called when the operation is complete.
27352  Precondition:
27353  The DRV_SPI_Initialize routine must have been called for the specified
27354  SPI driver instance.
27355  DRV_SPI_Open must have been called to obtain a valid opened device
27356  handle.
27357  Parameters:
27358  handle - A valid open-instance handle, returned from the driver's
27359  open routine
27360  txBuffer - The buffer which hold the data.
27361  txSize - Number of bytes to be written to the SPI bus.
27362  rxBuffer - The buffer to which the data should be written to.
27363  rxSize - Number of bytes to be read from the SPI bus
27364  completeCB - Pointer to a function to be called when this queued operation is complete
27365  context - unused by the driver but this is passed to the callback when it is called
27366  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27367  Returns:
27368  If the buffer add request is successful, a valid buffer handle is returned.
27369  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27370  Example:
27371  <code>
27372  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27373  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27374  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27375  switch ( state )
27376  {
27377  case 0:
27378  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27379  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27380  {
27381  state++;
27382  }
27383  break;
27384  case 1:
27385  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27386  {
27387  state++;
27388  // All transmitter data has been sent successfully.
27389  }
27390  break;
27391  }
27392  </code>
27393  Remarks:
27394  None.
27395 */
27396 
27399  DRV_HANDLE handle ,
27400  void * txBuffer ,
27401  size_t txSize ,
27402  void * rxBuffer ,
27403  size_t rxSize ,
27404  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27405  void * context ,
27406  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27407 // *****************************************************************************
27408 /* Function:
27409  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27410  Summary:
27411  Returns the transmitter and receiver transfer status.
27412  <p><b>Implementation:</b> Static/Dynamic</p>
27413  Description:
27414  This returns the transmitter and receiver transfer status.
27415  Precondition:
27416  The DRV_SPI_Initialize routine must have been called for the specified
27417  SPI driver instance.
27418  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27419  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27420  the buffer handle associated with that transfer.
27421  Parameters:
27422  bufferHandle - A valid buffer handle, returned from the driver's
27423  data transfer routine
27424  Returns:
27425  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27426  transfer.
27427  Example:
27428  <code>
27429  // Buffer handle returned from the data transfer function
27430  DRV_SPI_BUFFER_HANDLE bufferHandle;
27431  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27432  {
27433  // All transmitter data has been sent.
27434  }
27435  </code>
27436  Remarks:
27437  The returned status may contain a value with more than one of the bits
27438  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27439  should perform an AND with the bit of interest and verify if the
27440  result is non-zero (as shown in the example) to verify the desired status
27441  bit.
27442 */
27443 
27446  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27447 // *****************************************************************************
27448 /* Function:
27449  bool DRV_SPIn_ReceiverBufferIsFull(void)
27450  Summary:
27451  Returns the receive buffer status. 'n' represents the instance of the
27452  SPI driver used.
27453  <p><b>Implementation:</b> Static</p>
27454  Description:
27455  This function returns the receive buffer status (full/empty).
27456  Precondition:
27457  None.
27458  Parameters:
27459  None.
27460  Returns:
27461  Receive Buffer Status
27462  - 1 - Full
27463  - 0 - Empty
27464  Example:
27465  <code>
27466  bool rxBufStat;
27467  // Using instance 1 of SPI driver, that is n = 1
27468  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27469  if (rxBufStat)
27470  {
27471  ...
27472  }
27473  </code>
27474  Remarks:
27475  None.
27476 */
27477 
27478 bool
27480 // *****************************************************************************
27481 /* Function:
27482  bool DRV_SPIn_TransmitterBufferIsFull(void)
27483  Summary:
27484  Returns the transmit buffer status. 'n' represents the instance of the
27485  SPI driver used.
27486  <p><b>Implementation:</b> Static</p>
27487  Description:
27488  This function returns the transmit buffer status (full/empty).
27489  Precondition:
27490  None.
27491  Parameters:
27492  None.
27493  Returns:
27494  Transmit Buffer Status
27495  - 1 - Full
27496  - 0 - Empty
27497  Example:
27498  <code>
27499  bool txBufStat;
27500  // Using instance 1 of SPI driver, that is n = 1
27501  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27502  if (txBufStat)
27503  {
27504  ...
27505  }
27506  </code>
27507  Remarks:
27508  None.
27509 */
27510 
27511 bool
27513 //DOM-IGNORE-BEGIN
27514 //DOM-IGNORE-END
27515  // #ifndef _DRV_SPI_H
27516 /*******************************************************************************
27517  End of File
27518 */
27519 
27520 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27521 /* CLOSE_FILE Include File */
27522 
27523 #include "driver/usb/usbhs/drv_usbhs.h"
27524 /* LDRA REMOVE #include "usb/usb_device.h" */
27525 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27526 /**************************************************************************************/
27527 /* LDRA_INSPECTED 110 S
27528 */
27544 /**************************************************************************************/
27545 #ifndef APP_H /* Guard against multiple inclusion.*/
27546 #define APP_H
27547 /**************************************************************************************/
27548 /* ************************************************************************************/
27549 /* Section: Included Files */
27550 /**************************************************************************************/
27551 /**************************************************************************************/
27552 #include <stdint.h>
27553 /**************************************************************************************/
27554 /**************************************************************************************/
27555 /* Section: Data Types */
27556 /**************************************************************************************/
27557 /**************************************************************************************/
27558 /**************************************************************************************/
27559 /* APP_DATA
27560  Summary:
27561  Holds APP_DATA used for the APP tasks.
27562  Description:
27563  Holds APP_DATA used for the APP tasks. The variables
27564  used are stored here.
27565  Remarks:
27566  None
27567  */
27568 
27569 typedef
27570  struct
27571  {
27572  uint8_t RevNumber ;
27573  } APP_DATA ;
27574 
27575 extern APP_DATA
27576  APP ;
27577 /**************************************************************************************/
27578 /**************************************************************************************/
27579 /* Section: Application Initialization and State Machine Functions */
27580 /**************************************************************************************/
27581 /**************************************************************************************/
27582 /*!*************************************************************************************
27583  Function:
27584  void APP_Initialize(void)
27585  Summary:
27586  Autonomous tool application initialization routine.
27587  Description:
27588  This function initializes the application. It places the
27589  application in its initial state and prepares it to run so that its
27590  APP_Tasks function can be called.
27591  Precondition:
27592  All other system initialization routines should be called before calling
27593  this routine (in "SYS_Initialize").
27594  Parameters:
27595  None.
27596  Returns:
27597  None.
27598  Example:
27599  APP_Initialize()
27600  Remarks:
27601  This routine must be called from the main function.
27602 */
27603 
27604 void
27605  APP_Initialize ( void ) ;
27606 /*!*************************************************************************************
27607  Function:
27608  void APP_Tasks(void)
27609  Summary:
27610  Application tasks function
27611  Description:
27612  This function is the main application's tasks function. It contains the various
27613  tasks that are maintained during the operation of the shooting panel.
27614  Precondition:
27615  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27616  should be called before calling this.
27617  Parameters:
27618  None.
27619  Returns:
27620  None.
27621  Example:
27622  APP_Tasks()
27623  Remarks:
27624  This routine must be called from the main() routine.
27625  */
27626 
27627 void
27628  APP_Tasks ( void ) ;
27629  /* APP_H */
27630 /***************************************************************************************
27631  End of File
27632  */
27633 
27634 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
27635 /* CLOSE_FILE Include File */
27636 
27637 // DOM-IGNORE-BEGIN
27638 // DOM-IGNORE-END
27639 // *****************************************************************************
27640 // *****************************************************************************
27641 // Section: Type Definitions
27642 // *****************************************************************************
27643 // *****************************************************************************
27644 // *****************************************************************************
27645 /* System Objects
27646  Summary:
27647  Structure holding the system's object handles
27648  Description:
27649  This structure contains the object handles for all objects in the
27650  MPLAB Harmony project's system configuration.
27651  Remarks:
27652  These handles are returned from the "Initialize" functions for each module
27653  and must be passed into the "Tasks" function for each module.
27654 */
27655 
27656 typedef
27657  struct
27658  {
27659  SYS_MODULE_OBJ sysTmr ;
27660  SYS_MODULE_OBJ drvTmr0 ;
27661  SYS_MODULE_OBJ drvTmr1 ;
27662  SYS_MODULE_OBJ drvTmr2 ;
27663  SYS_MODULE_OBJ drvTmr3 ;
27664  SYS_MODULE_OBJ drvTmr4 ;
27665  SYS_MODULE_OBJ drvUsart0 ;
27666  SYS_MODULE_OBJ drvPMP0 ;
27667  /*** SPI Object for Index 0 ***/
27668  SYS_MODULE_OBJ spiObjectIdx0 ;
27669  /*** SPI Object for Index 1 ***/
27670  SYS_MODULE_OBJ spiObjectIdx1 ;
27671  /*** SPI Object for Index 2 ***/
27672  SYS_MODULE_OBJ spiObjectIdx2 ;
27673  SYS_MODULE_OBJ drvUSBObject ;
27674  SYS_MODULE_OBJ usbDevObject0 ;
27675  } SYSTEM_OBJECTS ;
27676 // *****************************************************************************
27677 // *****************************************************************************
27678 // Section: extern declarations
27679 // *****************************************************************************
27680 // *****************************************************************************
27681 
27682 extern SYSTEM_OBJECTS
27683  sysObj ;
27684 //DOM-IGNORE-BEGIN
27685 //DOM-IGNORE-END
27686  /* _SYS_DEFINITIONS_H */
27687 /*******************************************************************************
27688  End of File
27689 */
27690 
27691 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
27692 /* CLOSE_FILE Include File */
27693 
27694 /* LDRA_HEADER_END
27695 :
27696 This
27697 resets
27698 the
27699 header
27700 comment
27701 count.
27702 */
27703 /**************************************************************************************/
27704 /**************************************************************************************/
27705 /* Section: Structure Data and Local Variables */
27706 /**************************************************************************************/
27707 /**************************************************************************************/
27708 /* ADC Data
27709  Summary:
27710  These structures hold the required states and variables to perform the ADC tasks.
27711  Description:
27712  These structures hold the required states and variables to perform the ADC tasks.
27713  These are here to link these structures for use by the local functions.
27714 
27715  Remarks:
27716  These are defined in adc.h
27717 */
27718 
27719 ADC_DATA
27721 
27722 static ADC_STATES
27724 /**************************************************************************************/
27725 /**************************************************************************************/
27726 /* Section: State Machine Functions */
27727 /**************************************************************************************/
27728 /**************************************************************************************/
27729 /***************************************************************************************
27730  Function:
27731  void ADC_Tasks ( void )
27732  Summary:
27733  This routine is the ADC_tasks function. It defines the (ADC) state machine and
27734  core logic.
27735  Remarks:
27736  Refer to the adc.h interface header for function usage details.
27737  */
27738 
27739 void
27740  ADC_Tasks ( void ) /* ADC state machine.*/
27741  {
27742  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
27743  switch (
27744  ( ( int )( /* 29 */
27745  ADC.state
27746  ))*
27747  ((bitmapstruct.element1 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ) /* 19 */
27748  ) /* Check the machines current state.*/
27749  {
27750  case ADC_STATE_INIT :
27751  ((bitmapstruct.element1 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 30) : 0)), 1 ); /* 41 */
27752  /* This machines initial state.*/
27753  {
27754  ( void ) DRV_TMR4_Start () ;/* Start the trigger timer 4 instance (using timer 3)for the ADC. Set for 1mS.*/
27755  DRV_ADC0_Open () ; /* Open two channels for the ADC.*/
27756  DRV_ADC1_Open () ; /* ADC1 will be used to scan channels.*/
27757  ADC.state = ADC_STATE_IDLE ; /* Move on to idle for the ADC interrupt to show readings are available.*/
27758  }
27759  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 16 */
27760  goto l127539 ;
27761  case ADC_STATE_WAIT :
27762  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 0) : 0)), 1 ); /* 41 */
27763  /* Wait for the ADC operation to complete.*/
27764  {
27765  if
27766  (
27767  ( ADC.ADCInt == true )
27768  ) /* The ADC interrupt routine sets this flag when the conversion is complete.*/
27769  {
27770  ((int)(bitmapstruct.element2 |= (1 << 1))); /* 1 */
27771  {
27772  ADC.ADCInt = false ; /* Reset the flag.*/
27773  ADC.state = ADC_STATE_WAIT_FOR_TIMER ; /* Wait for the next timer tick.*/
27774  }
27775  } else ((int)(bitmapstruct.element2 |= (1 << 2))); /* 4 */
27776  }
27777  ((int)(bitmapstruct.element2 |= (1 << 3))); /* 16 */
27778  goto l127539 ;
27780  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 4) : 0)), 1 ); /* 41 */
27781  /* Wait for the next timer pulse to check for ADC results.*/
27782  {
27783  if
27784  (
27785  ADC.tick == true
27786  ) /* Indicates the timer has completed. Start another ADC capture.*/
27787  {
27788  ((int)(bitmapstruct.element2 |= (1 << 5))); /* 1 */
27789  {
27790  ADC.tick = false ; /* Reset flag.*/
27791  ADC.state = ADC_STATE_WAIT ; /* Switch task to wait for another ADC capture.*/
27792  }
27793  } else ((int)(bitmapstruct.element2 |= (1 << 6))); /* 4 */
27794  }
27795  ((int)(bitmapstruct.element2 |= (1 << 7))); /* 16 */
27796  goto l127539 ;
27797  case ADC_STATE_IDLE :
27798  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 8) : 0)), 1 ); /* 41 */
27799  {
27800  }
27801  ((int)(bitmapstruct.element2 |= (1 << 9))); /* 16 */
27802  goto l127539 ;
27803  default :
27804  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 10) : 0)), 1 ); /* 41 */
27805  /* The default state should never be executed. */
27806  {
27807  /* Comment.*/
27808  }
27809  ((int)(bitmapstruct.element2 |= (1 << 11))); /* 16 */
27810  goto l127539 ;
27811  }
27812 l127539 :
27813  ; /* 18 */
27814  ((int)(bitmapstruct.element2 |= (1 << 12))); /* 30 */
27815  adc_63zqendz ( 77 ) ; /* 30 */
27816  }
27817 /***************************************************************************************
27818  End of File
27819  */
27820 #define qqqbranches 77
27821 #define QQQMAXMCDCSIZE 2
27822 /********************** LDRA_PORT INSTRUMENTATION **********************/
27823 
27824 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
27825 #define ldra_sscanf
27826  /* put in undefs to protect our parameter names from macros */
27827 #undef f
27828 #undef i
27829 #undef j
27830 #undef k
27831 #undef s
27832 #undef l
27833 #undef ii
27834 #undef some
27835 #undef none
27836 #undef from
27837 #undef a
27838 #undef b
27839 #undef iz
27840 #undef jz
27841 #undef qqnull_params
27842 #define qqnull_params void
27843  /* Conventional Instrumentation */
27844 #define qqzzidfield 1
27845  /* single file or fileid */
27846  /* these have an extra field for the fileid */
27847  static char qqqqone[] = "%6d\n"; /* single point */
27848  /* uncompressed data structures */
27849  /* uncompressed bitmap */
27850 #define QQQFIXEDSIZE
27851  static int qqqlast = 0;
27852  extern int qqupload_registered;
27853  extern int adc_63zqqzqz(qqnull_params);
27854  extern int adc_63zqqzqz1(qqnull_params);
27855  /* ----------------------------------------------------------------------* 200 *
27856  * Procedures
27857  * -----------------------------------------------------------------------------
27858  */
27859  /* ----------- zscanf ---------------------------------------------------* 201 *
27860  * Returns an integer extracted from a string
27861  * -----------------------------------------------------------------------------
27862  */
27863  static int adc_63zscanf(char * qqscan_str)
27864  {
27865  int qqvalue;
27866  int qqisign;
27867  char * qqcptr;
27868  qqvalue = 0;
27869  qqisign = 1;
27870  qqcptr = qqscan_str;
27871  /* Skip spaces */
27872  while (qqcptr[0] == ' ')
27873  {
27874  qqcptr++;
27875  }
27876  /* Check for a leading ---
27877  */
27878  if (qqcptr[0] == '-')
27879  {
27880  qqisign = -1;
27881  qqcptr++;
27882  }
27883  /* Extract digits */
27884  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
27885  {
27886  qqvalue = 10 * qqvalue;
27887  qqvalue = qqvalue + (qqcptr[0] - '0');
27888  qqcptr++;
27889  }
27890  qqvalue = qqisign * qqvalue;
27891  return qqvalue;
27892  } /* end of zscanf */
27893  /* ----------------------------------------------------------------------* 210 *
27894  * C System utilities in use:
27895  * fprintf
27896  * fclose
27897  * sscanf
27898  * -----------------------------------------------------------------------------
27899  */
27900  /* ----------------------------------------------------------------------* 213 *
27901  * qqoutput* suite
27902  * Main output routines. These may require modification.
27903  * -----------------------------------------------------------------------------
27904  */
27905  /* ----------------------------------------------------------------------* 214 *
27906  * qqoutput
27907  * This is the principle output routine.
27908  * -----------------------------------------------------------------------------
27909  */
27910  static void qqoutput(FILEPOINT char * s,int i)
27911  /* f - file pointer, s - format string, i - integer for probe value */
27912  {
27913  /* printing to a file */
27914  /* fprintf exists, not threaded */
27915  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
27916  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
27917  ldra_port_write (&ldra_buffer[0]);
27918  } /* end of qqoutput */
27919  /* ----------------------------------------------------------------------* 215 *
27920  * qqoutput0
27921  * -----------------------------------------------------------------------------
27922  */
27923  static void qqoutput0(FILEPOINT char * s)
27924  {
27925  ldra_port_write(s);
27926  } /* end of qqoutput0 */
27927  /* ----------------------------------------------------------------------* 216 *
27928  * qqoutput2
27929  * -----------------------------------------------------------------------------
27930  */
27931  static void qqoutput2(FILEPOINT char * s,int i, int j)
27932  {
27933  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
27934  ldra_port_write (&ldra_buffer[0]);
27935  } /* end of qqoutput2 */
27936  /* ----------------------------------------------------------------------* 217 *
27937  * qqoutput3
27938  * -----------------------------------------------------------------------------
27939  */
27940  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
27941  {
27942  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
27943  ldra_port_write (&ldra_buffer[0]);
27944  } /* end of qqoutput3 */
27945  /* ----------------------------------------------------------------------* 218 *
27946  * qqoutput4
27947  * -----------------------------------------------------------------------------
27948  */
27949  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
27950  {
27951  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
27952  ldra_port_write (&ldra_buffer[0]);
27953  } /* end of qqoutput4 */
27954  /* ----------------------------------------------------------------------* 219 *
27955  * end of qqoutput* suite
27956  * -----------------------------------------------------------------------------
27957  */
27958  /* ----------------------------------------------------------------------* 222 *
27959  * qqqqinitialise
27960  * This procedure initialises the structures for
27961  * compressed execution histories.
27962  * -----------------------------------------------------------------------------
27963  */
27964  static void qqqqinitialise(int ii)
27965  {
27966  unsigned int i;
27967  /* First time through. */
27968  /* bitmap */
27969  /* bitmap separate */
27970  qqqlast = 1; /* stops qqfun() calling initialise again */
27971  /* bitmap */
27972  /* bitmap singlefile */
27973  /* struct singlefile notmainfl */
27974  } /* end of qqqqinitialise */
27975 /* ----------------------------------------------------------------------* 225 *
27976 * qqqbitmapreset
27977 * This procedure resets the structures for
27978 * compressed execution histories.
27979 * -----------------------------------------------------------------------------
27980 */
27981 static void qqqbitmapreset()
27982 {
27983 struct bitmapstruct_t localbitmap = {0};
27984 bitmapstruct = localbitmap;
27985 } /* end of qqqbitmapreset */
27986 #undef QQQTEMP1
27987 #define QQQTEMP1
27988  /* ----------- zqqzqz ---------------------------------------------------* 310 *
27989  * -----------------------------------------------------------------------------
27990  */
27991  /* ----------------------------------------------------------------------* 312 *
27992  * This routine opens the execution history file. It is instrumented at the
27993  * start of the main program if one exists in the file. In general this is
27994  * superceded by adc_63zqqzqz1 below.
27995  * -----------------------------------------------------------------------------
27996  */
27998  {
27999  if ( adc_63zzopen != 1 )
28000  {
28001 #undef QQQMUSTOPEN
28002  adc_63zzopen = 1;
28003  }
28004  return(1);
28005  } /* end of zqqzqz */
28006  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
28007  * -----------------------------------------------------------------------------
28008  */
28009  /* ----------------------------------------------------------------------* 317 *
28010  * This routine also opens the execution history file. It is called
28011  * automatically if a probe fires and the execution history is not already
28012  * opened (adc_63zzopen = 0 ).
28013  * Because this always works ( it was intended for files with no main program
28014  * it is now the de facto common way to open the execution history.
28015  * -----------------------------------------------------------------------------
28016  */
28018  {
28019  if ( adc_63zzopen != 1 )
28020  {
28021  ldra_port_open(); /* 7 */
28022  qqqqinitialise(0);
28023  adc_63zzopen = 1;
28024  }
28025  return(1);
28026  } /* end of zqqzqz1 */
28027  /* ----------- zqendz ---------------------------------------------------* 330 *
28028  * This routine is called on exiting a routine in a
28029  * module. It closes the execution history.
28030  * -----------------------------------------------------------------------------
28031  */
28032 static int adc_63zqendz(int qqqi)
28033  {
28034  if (!qqqstructzzopen)
28035  {
28037  qqqstructzzopen = 1;
28038  }
28039  if ( adc_63zzopen != 1 )
28040  {
28041  adc_63zqqzqz1();
28042  }
28043  /* ----------------------------------------------------------------------* 331 *
28044  * this is the one which puts an integer into
28045  * the execution history file and returns unity.
28046  * The format of each field consists of six columns,
28047  * the number is right justified in this field.
28048  * -----------------------------------------------------------------------------
28049  */
28050  if ( adc_63zzopen )
28051  {
28052  /* uncompressed */
28053  /* uncompressed unbuffered */
28054  /* uncompressed unbuffered bitmap */
28055  if ( qqqi > 0 )
28056  {
28057  }
28058  else
28059  {
28060  }
28061  }
28062  qqqlast = 0;
28063  return(1);
28064  } /* end of zqendz */
28065  /* ----------------------------------------------------------------------* 335 *
28066  * Output structure - qqbmsoutput
28067  * -----------------------------------------------------------------------------
28068  */
28069  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
28070  {
28071  static int branches_printed = 0;
28072  int b, last = 0;
28073  for(b=0;b<qqqqbmselwidth/8;b++)
28074  {
28075  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
28076  ldra_port_write (&ldra_buffer[0]);
28077  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
28078  ldra_port_write (&ldra_buffer[0]);
28079  last += 8;
28080  branches_printed += 8;
28081  if (branches_printed >= qqqbranches)
28082  {
28083  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
28084  break;
28085  }
28086  }
28087  }
28088  /* ----------------------------------------------------------------------* 336 *
28089  * qqqupload
28090  * This routine loops through the stored bitmap and
28091  * outputs it. It then uploads the stored mcdc.
28092  * -----------------------------------------------------------------------------
28093  */
28094  static void qqqupload(qqnull_params)
28095  {
28096  int i;
28097  /* uncompressed bitmap (!singlefile or mainfl) separate */
28098  {
28099  adc_63zqqzqz1();
28100 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
28101 #define LASTELEMENT
28102 #include "adc_63zbelem.def"
28103 #undef LASTELEMENT
28104 #undef ELEMENT
28105  }
28106  /* bitmap separate */
28107  qqqlast = 1; /* stops qqfun() calling initialise again */
28108  } /* end of qqqupload */
28109  /* ----------- zqzqzq ---------------------------------------------------* 342 *
28110  * -----------------------------------------------------------------------------
28111  */
28112  /* ----------------------------------------------------------------------* 344 *
28113  * This routine should be called before the program
28114  * terminates. It closes the execution history
28115  * -----------------------------------------------------------------------------
28116  */
28117  static int adc_63zqzqzq(int qqqi)
28118  {
28119  if ( adc_63zzopen != 1 )
28120  {
28121  adc_63zqqzqz1();
28122  }
28123  /* not compressed */
28124  /* do nothing for bitmap*/
28125  /* upload the history */
28126  /* bitmap */
28127  /* uncompressed bitmap */
28128  adc_63zqendz(qqqi);
28129  /* qqqupload closes the execution history file */
28130  return(1);
28131  } /* end of zqzqzq */
28132  /* the following routines should be left alone */
28133 /* END OF TESTBED INSTRUMENTATION */
28134 
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
DRV_IO_BUFFER_TYPES
Definition: inszt_adc.c:1076
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
void SYS_DMA_Suspend(void)
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
void DRV_ADC_Initialize(void)
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
uint32_t DRV_TMR4_PeriodValueGet(void)
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
static void qqoutput0(FILEPOINT char *s)
Definition: inszt_adc.c:27923
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
ADC_STATES
Definition: inszt_adc.c:231
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
Definition: inszt_adc.c:27940
APP_DATA APP
Definition: app.c:73
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
ADC_STATES state
Definition: adc.h:81
INT_SOURCE interruptSource
Definition: inszt_adc.c:1906
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
Definition: inszt_adc.c:15196
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
void DRV_TMR0_CounterValueSet(uint32_t value)
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
void DRV_TMR4_StopInIdleEnable(void)
static void DRV_TMR0_Tasks(void)
Definition: inszt_adc.c:3785
void DRV_USART0_Deinitialize(void)
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
void DRV_TMR_Stop(DRV_HANDLE handle)
void DRV_TMR_CounterClear(DRV_HANDLE handle)
DRV_USART_ERROR error
Definition: inszt_adc.c:18264
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
void DRV_USART0_Close(void)
void DRV_TMR4_PeriodValueSet(uint32_t value)
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
DRV_USART_OPERATION_MODE_DATA modeData
Definition: inszt_adc.c:15541
uint32_t SYS_DMA_ChannelCRCGet(void)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR1_DeInitialize(void)
Definition: inszt_adc.c:3814
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
void DRV_TMR0_PeriodValueSet(uint32_t value)
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
static int qqqstructzzopen
Definition: inszt_adc.c:136
TMR_PRESCALE prescale
Definition: inszt_adc.c:1902
USART_MODULE_ID usartID
Definition: inszt_adc.c:15533
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
uint8_t DRV_USART0_ReadByte(void)
static struct bitmapstruct_t bitmapstruct
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static ADC_STATES A_STATES
Definition: inszt_adc.c:27723
static void DRV_TMR1_Open(void)
Definition: inszt_adc.c:3834
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
uint32_t DRV_TMR3_PeriodValueGet(void)
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
struct _DRV_SPI_INIT DRV_SPI_INIT
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
Definition: inszt_adc.c:26515
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
static void DRV_TMR1_Tasks(void)
Definition: inszt_adc.c:3895
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
void DRV_TMR4_StopInIdleDisable(void)
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
INT_SOURCE dmaInterruptReceive
Definition: inszt_adc.c:15605
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:17596
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static void DRV_TMR0_Close(void)
Definition: inszt_adc.c:3745
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
static void DRV_TMR2_DeInitialize(void)
Definition: inszt_adc.c:3924
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
void PLIB_DMA_Disable(DMA_MODULE_ID index)
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
void DRV_USART_Close(const DRV_HANDLE handle)
uint32_t DRV_TMR3_CounterFrequencyGet(void)
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
Definition: inszt_adc.c:4175
INT_SOURCE interruptTransmit
Definition: inszt_adc.c:15571
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
static int qqqisinitialised
Definition: inszt_main.c:152
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
void DRV_ADC_DeInitialize(void)
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
void DRV_USART0_WriteByte(const uint8_t byte)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
void DRV_TMR2_Initialize(void)
uint32_t DRV_TMR1_CounterValueGet(void)
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR0_CounterClear(void)
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
SYS_MODULE_OBJ sysTmr
Definition: inszt_adc.c:27659
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
static void qqoutput2(FILEPOINT char *s, int i, int j)
Definition: inszt_adc.c:27931
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
void ADC_Tasks(void)
Definition: inszt_adc.c:27740
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
bool ADCInt
Definition: adc.h:91
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
uint32_t brgClock
Definition: inszt_adc.c:15551
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
void DRV_TMR1_StopInIdleDisable(void)
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
static int adc_63zscanf(char *qqscan_str)
Definition: inszt_adc.c:27863
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR4_CounterClear(void)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
uint32_t DRV_TMR4_CounterValueGet(void)
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
SYS_MODULE_OBJ spiObjectIdx1
Definition: inszt_adc.c:27670
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
SYS_ERROR_LEVEL gblErrLvl
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
static void qqqqinitialise(int ii)
Definition: inszt_adc.c:27964
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
void(* ldra_void_function)()
Definition: inszt_adc.c:114
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
bool DRV_SPIn_ReceiverBufferIsFull(void)
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
bool DRV_TMR3_Start(void)
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
ADC_DATA ADC
Definition: inszt_adc.c:27720
SYS_MODULE_OBJ drvTmr2
Definition: inszt_adc.c:27662
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t baudRate
Definition: inszt_adc.c:26572
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
void DRV_TMR1_CounterClear(void)
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
void DRV_PMP0_ModeConfig(void)
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
Definition: inszt_adc.c:15228
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
int QQQindicator
Definition: inszt_main.c:104
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
void PLIB_USART_Disable(USART_MODULE_ID index)
static void DRV_TMR3_Close(void)
Definition: inszt_adc.c:4075
DRV_TMR_CLK_SOURCES clockSource
Definition: inszt_adc.c:1900
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
#define qqnull_params
Definition: inszt_adc.c:27842
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
static void DRV_TMR2_Close(void)
Definition: inszt_adc.c:3965
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR1_CounterValueSet(uint32_t value)
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
bool DRV_USART0_ReceiverBufferIsEmpty(void)
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
uint32_t baud
Definition: inszt_adc.c:15559
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
#define qqqbranches
Definition: inszt_adc.c:27820
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
void DRV_TMR2_StopInIdleDisable(void)
void SYS_PORTS_Initialize()
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
void qqqtotalreset(void)
Definition: inszt_main.c:7067
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
uint32_t DRV_TMR2_CounterValueGet(void)
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
TMR_MODULE_ID tmrId
Definition: inszt_adc.c:1898
static SYS_STATUS DRV_TMR2_Status(void)
Definition: inszt_adc.c:3933
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
bool DRV_USART0_TransmitBufferIsFull(void)
void DRV_USART0_TasksReceive(void)
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
void DRV_USART0_TasksError(void)
bool asyncWriteEnable
Definition: inszt_adc.c:1914
void DRV_TMR_Close(DRV_HANDLE handle)
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
void DRV_IC0_Initialize(void)
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
SYS_DMA_CRC_WRITE_ORDER writeOrder
Definition: inszt_adc.c:13449
void DRV_TMR0_StopInIdleEnable(void)
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_MODULE_OBJ drvTmr4
Definition: inszt_adc.c:27664
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
static SYS_STATUS DRV_TMR4_Status(void)
Definition: inszt_adc.c:4153
static int adc_63zqendz(int qqqi)
Definition: inszt_adc.c:28032
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
static void DRV_TMR3_Open(void)
Definition: inszt_adc.c:4054
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_ADC0_Close(void)
SYS_MODULE_OBJ drvPMP0
Definition: inszt_adc.c:27666
void SYS_DMA_Resume(void)
void DRV_ADC1_Close(void)
void DRV_ADC_Start(void)
uint32_t DRV_TMR1_PeriodValueGet(void)
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
bool DRV_TMR2_Start(void)
void DRV_IC_Stop(DRV_HANDLE handle)
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_IO_INTENT
Definition: inszt_adc.c:975
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
INT_SOURCE dmaInterruptTransmit
Definition: inszt_adc.c:15601
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
unsigned int queueSizeReceive
Definition: inszt_adc.c:15584
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
int QQQfcn_ptr_num
Definition: inszt_main.c:151
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
DRV_USART_HANDSHAKE handshake
Definition: inszt_adc.c:15562
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
Definition: inszt_adc.c:13629
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void DRV_TMR4_Initialize(void)
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
Definition: inszt_adc.c:1928
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
bool DRV_IC0_BufferIsEmpty(void)
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
static void DRV_TMR0_DeInitialize(void)
Definition: inszt_adc.c:3704
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
static void DRV_TMR3_Tasks(void)
Definition: inszt_adc.c:4115
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
void DRV_TMR2_CounterValueSet(uint32_t value)
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
DRV_USART_INIT_FLAGS flags
Definition: inszt_adc.c:15546
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
void DRV_TMR3_Initialize(void)
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
#define DRV_IC_Open(drvIndex, intent)
Definition: inszt_adc.c:1417
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
unsigned int queueSizeTransmit
Definition: inszt_adc.c:15589
uint32_t DRV_TMR2_CounterFrequencyGet(void)
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
void DRV_PMP0_Write(uint8_t data)
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
void DRV_PMP0_Initialize(void)
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
Definition: inszt_adc.c:27949
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
ADC_STATES
Definition: adc.h:55
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
void DRV_TMR3_StopInIdleEnable(void)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
#define adc_63zzopen
Definition: inszt_adc.c:76
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
Definition: inszt_adc.c:3955
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
void DRV_IC0_Start(void)
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
SYS_MODULE_OBJ spiObjectIdx0
Definition: inszt_adc.c:27668
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
DRV_USART_LINE_CONTROL lineControl
Definition: inszt_adc.c:15555
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void DRV_TMR3_StopInIdleDisable(void)
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
static SYS_STATUS DRV_TMR0_Status(void)
Definition: inszt_adc.c:3713
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
static SYS_STATUS DRV_TMR1_Status(void)
Definition: inszt_adc.c:3823
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void APP_Tasks(void)
Definition: app.c:130
void DRV_TMR3_PeriodValueSet(uint32_t value)
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
void DRV_TMR2_Stop(void)
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void DRV_TMR2_StopInIdleEnable(void)
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
void DRV_TMR3_Stop(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
SYS_MODULE_OBJ drvTmr1
Definition: inszt_adc.c:27661
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
DRV_USART_ERROR
Definition: inszt_adc.c:15426
SYS_DMA_CHANNEL_CRC_MODE mode
Definition: inszt_adc.c:13437
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
static SYS_STATUS DRV_TMR3_Status(void)
Definition: inszt_adc.c:4043
uint8_t queueSize
Definition: inszt_adc.c:26592
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
Definition: inszt_adc.c:3735
int qqqshell_upload
Definition: inszt_main.c:150
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
#define QQQnumfil
Definition: inszt_adc.c:50
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
INT_SOURCE interruptReceive
Definition: inszt_adc.c:15575
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
static void DRV_TMR2_Tasks(void)
Definition: inszt_adc.c:4005
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
SYS_DMA_DATA_WIDTH
Definition: inszt_adc.c:13522
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
SYS_ERROR_LEVEL errorLevel
Definition: inszt_adc.c:17598
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
void DRV_TMR2_PeriodValueSet(uint32_t value)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
bool DRV_TMR0_Start(void)
static void DRV_TMR4_Close(void)
Definition: inszt_adc.c:4185
static void DRV_TMR0_Open(void)
Definition: inszt_adc.c:3724
static int QQQfirstmcdc
Definition: inszt_adc.c:75
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
DMA_CHANNEL dmaChannelReceive
Definition: inszt_adc.c:15597
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
void PLIB_DMA_Enable(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
DRV_TMR_OPERATION_MODE mode
Definition: inszt_adc.c:1910
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
SYS_DMA_CHANNEL_CHAIN_PRIO
Definition: inszt_adc.c:13295
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
USART_OPERATION_MODE linesEnable
Definition: inszt_adc.c:15567
DRV_ADC_MODULE_ID
Definition: inszt_adc.c:1509
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
uint32_t DRV_TMR3_CounterValueGet(void)
SYSTEM_OBJECTS sysObj
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
static int tbrun_mode
Definition: inszt_adc.c:96
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
void DRV_TMR1_Stop(void)
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
void DRV_ADC0_Open(void)
void SYS_DEBUG_Message(const char *message)
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
uint32_t DRV_IC0_Capture32BitDataRead(void)
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
static void qqqbitmapreset(qqnull_params)
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
static void DRV_TMR1_Close(void)
Definition: inszt_adc.c:3855
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
static unsigned char qqqzzglobflag
Definition: inszt_adc.c:166
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
void DRV_TMR1_PeriodValueSet(uint32_t value)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
void DRV_SPI_Close(DRV_HANDLE handle)
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:1896
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
Definition: inszt_adc.c:28069
void DRV_TMR1_StopInIdleEnable(void)
SYS_MODULE_OBJ drvTmr0
Definition: inszt_adc.c:27660
uint32_t DRV_TMR2_PeriodValueGet(void)
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
SYS_MODULE_OBJ spiObjectIdx2
Definition: inszt_adc.c:27672
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
SYS_MODULE_OBJ drvTmr3
Definition: inszt_adc.c:27663
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
bool DRV_TMR_Start(DRV_HANDLE handle)
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
static int adc_63zqqzqz(qqnull_params)
Definition: inszt_adc.c:27997
void DRV_ADC_Stop(void)
void DRV_TMR3_CounterClear(void)
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
SYS_MODULE_OBJ drvUSBObject
Definition: inszt_adc.c:27673
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void APP_Initialize(void)
Definition: app.c:93
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
static void DRV_TMR3_DeInitialize(void)
Definition: inszt_adc.c:4034
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
Definition: inszt_adc.c:4065
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
int qqupload_registered
Definition: inszt_main.c:6760
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void DRV_TMR2_CounterClear(void)
static void qqoutput(FILEPOINT char *s, int i)
Definition: inszt_adc.c:27910
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
static int adc_63zqzqzq(int qqqi)
Definition: inszt_adc.c:28117
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
#define adc_63zqqzqz1
Definition: inszt_adc.c:78
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
uint16_t DRV_IC0_Capture16BitDataRead(void)
Definition: app.h:59
static void qqqupload(qqnull_params)
Definition: inszt_adc.c:28094
SYS_STATUS DRV_USART0_Status(void)
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
Definition: adc.h:78
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
SYS_DMA_SIDL sidl
Definition: inszt_adc.c:13517
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
void DRV_IC0_Stop(void)
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
uint32_t DRV_TMR0_PeriodValueGet(void)
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_DEBUG_Print(const char *format,...)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
void DRV_USART0_TasksTransmit(void)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:15529
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
SYS_MODULE_INDEX consoleIndex
Definition: inszt_adc.c:17600
void PLIB_USART_Enable(USART_MODULE_ID index)
static void DRV_TMR4_Tasks(void)
Definition: inszt_adc.c:4225
DRV_USART_OPERATION_MODE mode
Definition: inszt_adc.c:15537
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
DMA_CHANNEL dmaChannelTransmit
Definition: inszt_adc.c:15593
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void DRV_TMR4_Stop(void)
SYS_MODULE_OBJ usbDevObject0
Definition: inszt_adc.c:27674
void DRV_TMR0_Initialize(void)
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
static int qqqqbmselwidth
Definition: inszt_adc.c:48
void PLIB_SPI_Enable(SPI_MODULE_ID index)
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
INT_SOURCE interruptError
Definition: inszt_adc.c:15579
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
void DRV_TMR1_Initialize(void)
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
uint32_t DRV_TMR0_CounterValueGet(void)
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR3_CounterValueSet(uint32_t value)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool DRV_TMR1_Start(void)
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
bool DRV_SPIn_TransmitterBufferIsFull(void)
SYS_MODULE_OBJ drvUsart0
Definition: inszt_adc.c:27665
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
bool tick
Definition: adc.h:90
static char qqqqone[]
Definition: inszt_adc.c:27847
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
static int qqqlast
Definition: inszt_adc.c:27851
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void DRV_TMR0_StopInIdleDisable(void)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
static void DRV_TMR4_Open(void)
Definition: inszt_adc.c:4164
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
#define DRV_IC_Close(handle)
Definition: inszt_adc.c:1418
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
Definition: inszt_adc.c:3845
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void DRV_TMR4_CounterValueSet(uint32_t value)
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
DRV_CLIENT_STATUS
Definition: inszt_adc.c:1019
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
static int zzfileid
Definition: inszt_adc.c:49
void DRV_TMR0_Stop(void)
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
uint8_t DRV_PMP0_Read(void)
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
static void DRV_TMR2_Open(void)
Definition: inszt_adc.c:3944
uint32_t DRV_TMR1_CounterFrequencyGet(void)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
static void DRV_TMR4_DeInitialize(void)
Definition: inszt_adc.c:4144
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_ADC1_Open(void)
bool SYS_DMA_IsBusy(void)
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
bool DRV_TMR4_Start(void)
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
#define FILEPOINT
Definition: inszt_adc.c:91
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)